Java Spring Mongo模板远程调用mapreduce

Java Spring Mongo模板远程调用mapreduce,java,spring,mongodb,Java,Spring,Mongodb,我有一个MapReduce函数来创建一个新集合,我通过spring模板调用它 public void mapReduce(String mapFile, String reduceFile, String finalizeFile, String collection_out ) { mongoTemplate.mapReduce(COLLECTION_NAME, mapFile, reduceFile, options().finalizeFunctio

我有一个MapReduce函数来创建一个新集合,我通过spring模板调用它

    public void mapReduce(String mapFile, String reduceFile, String finalizeFile, String collection_out )
{
    mongoTemplate.mapReduce(COLLECTION_NAME, mapFile, reduceFile,
            options().finalizeFunction(finalizeFile).outputCollection(collection_out), DBObject.class);

}
但是方法
mongoTemplate.mapReduce
返回集合,我不想要它,因为它在我的

Exception in thread "ajp-bio-8009-AsyncTimeout" java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception in thread "http-bio-8080-AsyncTimeout" Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" Exception in thread "application-1" java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded

我的新集合将返回大约8k的结果,我希望这是在mongo中创建的,而不是返回到Java

你看过输出了吗?注意到这个小提示了吗?是的,我试着取回列表,但仍然没有内存。也许你想增加JVM的可用内存。我希望它是对DB的远程调用,而不是JVM中的结果集。这实际上不是你想要什么。Tomcat无法分配所需的内存。除非这个问题得到解决,否则我们无法了解到底发生了什么。