2014-03-28 13 views
0

我的规格:增加堆空间可供JVM:OutOfMemoryError错误:请求的数组大小超过VM限制的Ubuntu 64位的Neo4j 2.0

-Ubuntu 64

-Neo4j 2.0

-32 GB的RAM的

-AMD FX-8350八核处理器

问题:

我正在做我的Neo4j服务器的请求用下面的查询:

MATCH (being:my_label_2) RETURN being 

,给我这个错误:

OutOfMemoryError 

Requested array size exceeds VM limit 

StackTrace: 
java.lang.StringCoding$StringEncoder.encode(StringCoding.java:300) 
java.lang.StringCoding.encode(StringCoding.java:344) 
java.lang.String.getBytes(String.java:916) 
org.neo4j.server.rest.repr.OutputFormat.toBytes(OutputFormat.java:194) 
org.neo4j.server.rest.repr.OutputFormat.formatRepresentation(OutputFormat.java:147) 
org.neo4j.server.rest.repr.OutputFormat.response(OutputFormat.java:130) 
org.neo4j.server.rest.repr.OutputFormat.ok(OutputFormat.java:67) 
org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:101) 
java.lang.reflect.Method.invoke(Method.java:606) 
org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139) 
org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112) 

这正常工作与“my_label_1”返回各地30k结果

我认为是什么问题:

我没有足够的内存分配给我的JVM作出修正/东西

尝试,我在网上找到的:

I read what the manual says to do

And what the Ubuntu Forums say to do

所以我试着去我的neo4文件夹(像往常一样cd),并用这种方式运行它的参数:

sudo bin/neo4j start -Xmx4096M 

但是没有奏效。当Neo4j的启动它提醒我,我可能不会有足够的空间:

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual. 
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled 

问题

我知道我肯定使用的参数错误,我真的不有太多的经验JVM配置。我该如何解决这个问题,我是否错过了一些东西?

+0

使用标题X-Stream:true,然后结果将流式传输到客户端。你首先如何提出你的要求? –

回答

2

您应该将JVM设置放入conf/neo4j-wrapper.conf文件中。它应该是这样的:

[email protected]:> head -n 7 neo4j-enterprise-2.0.0/conf/neo4j-wrapper.conf 
wrapper.java.additional=-Dorg.neo4j.server.properties=conf/neo4j-server.properties 
wrapper.java.additional=-Djava.util.logging.config.file=conf/logging.properties 
wrapper.java.additional=-Dlog4j.configuration=file:conf/log4j.properties 

# Java Additional Parameters 
wrapper.java.additional=-XX:+UseConcMarkSweepGC 
wrapper.java.additional=-XX:+CMSClassUnloadingEnabled 

请注意,您可以通过不同的文件配置的Neo4j的不同方面,所以最好在conf/目录,以便读取描述每一个文件,以熟悉什么可以做,如何。

+0

我已经知道了,但这正是我必须要解决的问题。很好的答案! – AngelloMaggio

相关问题