0
votes

I'm trying to get into a csv some query results from my neo4j DB graph. I have neo4j 2.2.6 version and I am facing java.lang.outofmemoryerror : Java Heap Space error while I was trying to get all of my nodes with some properties (~1M nodes,~4M rel Graph) to a csv on neo4jshell via import-cypher,export-cypher. When I change the wrapper (wrapper.java.maxmemory,wrapper.java.minmemory to 4g) as I've seen to some other post the error remains and when I change properties (dbms.pagecache.memory to 3g) it crushes before I even open the server.

1
Where do you get the error? On the shell? Could you write the command are you running?Alessandro Negro
Yes on the shell. The command is (or with import-cypher) export-cypher -o test10.csv MATCH (a)-[rel]-(b) WHERE NOT(rel.Weight IS NULL) RETURN id(a) as node,COLLECT(id(b)) as nbhood,COLLECT(rel.Weight) as edgeweight,COUNT(id(b)) as numnodes ORDER by id(a) ASCpanomi

1 Answers

0
votes

To test if it's a heap space problem you do not have to change the page cache, only the heap.

According to http://neo4j.com/docs/stable/server-performance.html the initmemory and maxmemory properties take the heap size in MB.

# neo4j-wrapper.conf
wrapper.java.initmemory=4000
wrapper.java.maxmemory=4000

In addition to the heap settings you can add a PERIODIC COMMIT to your LOAD CSV query. This will commit regularly to avoid memory errors: http://neo4j.com/docs/stable/query-periodic-commit.html

USING PERIODIC COMMIT 1000
LOAD CSV FROM ...