Hi,
after researching and a lot of trial and error, I was not able to figure out, what I'm doing wrong. So I ended up here writing my first post.
Here's what I'm trying to achieve. I have a graph with ~200M nodes and ~260M relationships. I want to introduce an inferred property like this:
CALL apoc.periodic.iterate(
'MATCH (n)-[:HAS_LOCATION]->(t) WHERE n.coordinates IS NULL RETURN n,t',
"SET n.coordinates=t.coordinates",
{batchSize:10000, parallel:true})
This query crashes neo4j 4.1.1 community edition (with apoc-4.1.0.0-all.jar) every time after a few minutes. In the debug logs I can see entries like
2020-10-18 21:35:40.856+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=123, gcTime=174, gcCount=1}
at the beginning, ramping up to
2020-10-18 21:42:40.558+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=15462, gcTime=15561, gcCount=4}
right before the crash.
The machine has 64GB of RAM. We configured it like this:
dbms.memory.heap.initial_size=24100m
dbms.memory.heap.max_size=24100m
dbms.memory.pagecache.size=30100m
dbms.memory.transaction.global_max_size=10000m
dbms.memory.transaction.max_size=5000m
I tried to lower the batch size (to 500), it did not help at all. Is there any chance, that this is data-related? Any idea, what is actually consuming so much memory? Will a node with two outgoing 'HAS_LOCATION' relationships cause issues?
Also, I was trying to count the nodes, for which to apply the SET operation:
MATCH (n)-[:HAS_LOCATION]->() WHERE n.coordinates IS NULL RETURN count(*)
This also crashes neo4j. I don't expect it to return fast, as it's scanning all the nodes, but I don't see why it should consume so much memory.
When I rephrase this query as
MATCH (n) WHERE (n)-[:HAS_LOCATION]->() AND n.coordinates IS NULL RETURN count(n)
it completed once and returned 3724 (after 15 minutes). Another invocation of it crashed, too.
Any hints would be appreciated.
-- matt