I am trying to add new edges between nodes which have paths of length 2. This is what I did:
Match path=((a:person)-[*2]-(b:person)) With a, b, Count(path) as weight Merge (a)-[e:co_authors]->(b) Set e.weight=weight
The number of person nodes I have in my database is 100001 and I found that the number of such paths of length 2 between Person nodes is 37817286.
I get a out of memory error:
Neo.TransientError.General.OutOfMemoryError: There is not enough memory to perform the current task. Please try increasing 'dbms.memory.heap.max_size' in the neo4j configuration (normally in 'conf/neo4j.conf' or, if you you are using Neo4j Desktop, found through the user interface) or if you are running an embedded installation increase the heap by using '-Xmx' command line flag, and then restart the database.
How do I fix the memory heap size?
Please keep the following things in mind:
- did you search for what you want to ask before posting?
- please use tags for additional info
- use a self-descriptive title
Please format code + Cypher statements with the code
</> icon, it's much easier to read.
Please provide the following information if you ran into a more serious issue:
- neo4j version, desktop version, browser version
- what kind of API / driver do you use
- screenshot of
EXPLAINwith boxes expanded (lower right corner)
- a sample of the data you want to import
- which plugins / extensions / procedures do you use
- neo4j.log and debug.log