Java Heap space issue while creating relationship between nodes

neo4j version - 4.3.6
desktop version - 1.4.9
browser version - 4.4.0

cypher query
//relationship- funclocation + Equipment
WHERE f.equipmenttag_d= e.equipmenttag_d
//RETURN f.equipmenttag_d, e.equipmenttag_d limit 5;

Error details : Java heap space
Any suggestion please

Hi @quamar.rashid

I think the number of noes is very large and one of the following will solve your problem.

1: Increase the heap size.

# 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.

You can change the heap size like this.


2: Use apoc.periodic.iterate
You need to install APOC plugin.

CALL apoc.periodic.iterate(
  "MATCH (f:funclocation),(e:equipmentno) WHERE f.equipmenttag_d = e.equipmenttag_d RETURN f,e",
  "MERGE (f)-[:HAS_EQUIPMENT]->(e)",
  {batchSize:1000, parallel:false})

Many thanks Koji, this worked

1 Like