我有一個Neo4j數據庫,有大約130K個節點,可能在17M關係之間。我的電腦運行Windows 10有16GB的RAM,其中10GB(最大)分配給Neo4j-shell堆。Neo4j:從neo4j-shell運行密碼查詢時出現OutOfMemoryError
我想在命令提示符下使用neo4j-shell運行一個查詢,並將結果重定向到一個csv文件。我使用該命令是:
Neo4jShell -v -file query.cql > results.csv
當查詢的形式爲:
MATCH (subject)-[:type1]->(intNode1:label)<-[:type2]-(intNode2:label)<-[:type3]-(object) RETURN subject.property1, object.property1;
的問題是,每當我運行此查詢,我得到一個OutOfMemory錯誤(見錯誤消息在底部)。
有沒有人有如何成功地運行這樣的查詢的建議?考慮到圖形數據庫的大小,我覺得10GB的RAM應該足夠用於這樣的查詢。
該錯誤消息我得到的是:
ERROR (-v for expanded information):
Error occurred in server thread; nested exception is:
java.lang.OutOfMemoryError: GC overhead limit exceeded
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$2.run(Unknown Source)
at sun.rmi.transport.Transport$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy1.interpretLine(Unknown Source)
at org.neo4j.shell.impl.AbstractClient.evaluate(AbstractClient.java:149)
at org.neo4j.shell.impl.AbstractClient.evaluate(AbstractClient.java:133)
at org.neo4j.shell.StartClient.executeCommandStream(StartClient.java:393)
at org.neo4j.shell.StartClient.grabPromptOrJustExecuteCommand(StartClient.java:372)
at org.neo4j.shell.StartClient.startRemote(StartClient.java:330)
at org.neo4j.shell.StartClient.start(StartClient.java:196)
at org.neo4j.shell.StartClient.main(StartClient.java:135)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
我只是用Neo4j的導入工具導入數據庫。我不確定這是否會創建索引,或者如果我需要手動執行它?感謝您的建議。當我到家裏的電腦時,我會嘗試他們,看看它是否有效。 – 12MonthsASlav
另外,你的電腦有多少內存?所以我知道如何設置我的記憶設置。 – 12MonthsASlav
我添加#wrapper.java.initmemory = 2048 #wrapper.java.maxmemory = 2048 – NKD