Reputation: 1
I am evaluating Neo4j in windows. Since, i need to access Neo4j from a .NET app, I am using the Neo4j Cypher REST API through a .NET client library (http://hg.readify.net/neo4jclient/).
When traversing a reasonably sized graph (About 100,000 nodes), I am facing "Out of memory" issues in the Neo4j java server. Below is the exception that is reported in the REST response. Also, mentioned below is the cypher query that was run. I have tried to increase the JVM heap space with a -Xmx1024m option for the Neo4j server, but that did not help. Would appreciate any other suggestions.
Unhandled Exception: System.ApplicationException: Received an unexpected HTTP st atus when executing the request.
The query was:
START x = node(1213997)
MATCH x-[:BOM*1..5]->n
RETURN 'BOM' AS RelationshipType, n.Number? AS Number, n.Id? AS Id
The response status was: 500 Java heap space
The raw response body was: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 Java heap space</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /db/data/cypher. Reason:
<pre> Java heap space</pre></p><h3>Caused by:</h3><pre>java.lang.OutOfMemoryE
rror: Java heap space
at java.lang.AbstractStringBuilder.<init>(Unknown Source)
at java.lang.StringBuilder.<init>(Unknown Source)
at org.neo4j.server.rest.repr.RepresentationType.<init>(Representa
tionType.java:108)
at org.neo4j.server.rest.repr.Representation.<init>(Representation
.java:73)
at org.neo4j.server.rest.repr.ListRepresentation.<init>(ListRepres
entation.java:36)
at org.neo4j.server.rest.repr.CypherResultRepresentation.data(CypherResu
ltRepresentation.java:64)
Upvotes: 0
Views: 1020
Reputation: 6331
In newer versions, you can do
start n = node(*) ...
see http://docs.neo4j.org/chunked/snapshot/query-start.html#start-all-nodes, to start at all nodes, which is what you want? But then, you are returning the whole graph a number of times back?
Upvotes: 0
Reputation: 3054
A depth 5 traversal can potentially touch the majority of your graph... what are you planning to do with the result? Is it necessary to return the entire result? If you're only using some part of it maybe you could specify that in the Cypher query directly to limit the result.
Upvotes: 0