5
votes

I've just setup neo4j 2.1.3 community for the first time and I run into a java heap space OutOfMemoryError when trying to load a dataset of about 17M.

I'm working on a Mac with 16GB memory and OS X 10.9.4 java version 1.7.0_21 and I tried increasing the heap size via the command line with:

java -Xmx2048m

Problem is that the jvm doesn't seem to recongize this. I'm not experienced in setting java settings this way.

Any suggestions?

2
what message does the jvm give you that you believe indicates that it did not recognize the flag?Amir Afghani
Try java -Xms512m -Xmx2048Mind Peace
Post your code for loading this dataset. There are common errors in loading that cause out of memory exceptions that wouldn't otherwise happen. You can also increase your memory, but it might be smarter to go about the load differently so you don't have to increase memory in the first place. Misuses of CREATE vs. MERGE can really easily create this problem.FrobberOfBits
Thanks for the suggestion I will try it as soon as I get the chance. The jvm doesn't give any error, it just doesn't seem to recognize the command.user3321659

2 Answers

3
votes

You can change settings of JVM heap in configuration file neo4j-wrapper.conf

# Java Heap Size: by default the Java heap size is dynamically
# calculated based on available system resources.
# Uncomment these lines to set specific initial and maximum
# heap size in MB.
#wrapper.java.initmemory=512
#wrapper.java.maxmemory=512

http://neo4j.com/docs/stable/server-performance.html

2
votes

Its worth noting that these configuration settings have now been moved to neo4j.conf: http://neo4j.com/docs/operations-manual/current/performance/#heap-sizing