Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-09-2020 08:05 AM
Hello, I have a memory problem in neo4j browser, the characteristics of the development environment are as follows.
Ubuntu 18.04 Neo4j Community 3.5.8.
dbms.memory.heap.initial_size 7.800 m
dbms.memory.heap.max_size 7.800 m
dbms.memory.pagecache.size 9.800 m
Workload is 10 GB
Memory configuration was made as recommended by neo4j-admin memrec. Here is a picture of the error.
05-09-2020 03:13 PM
Can you provide how much total memory the system has and if anything else is running on that machine.
Also, what is the query you are running and how big the data base is?
05-09-2020 03:30 PM
the system has 24 gb of ram and 1 tb of hard drive, all this in virtualbox in windows, this is the code and the workload is 14 gb
PROFILE
MATCH (:TagClass {name: 'Single'})<-[:HAS_TYPE]-(:Tag)<-[:HAS_TAG]-(message:Message)
WITH DISTINCT message
MATCH (message)-[:IS_LOCATED_IN]->(:Country)-[:IS_PART_OF]->(continent:Continent)
create (message)-[:BI_24_message_continent]->(continent)
05-10-2020 05:23 PM
Since Neo4j is an ACID database, commits to it must be atomic, so all changes must be handled in the same transaction.
In this case it looks like you're trying to do a graph-wide change, so most likely you're looking at hundreds of thousands to millions or more changes at once, and you don't have enough heap to keep all of that in heap memory at once.
You should look at leveraging periodic procedures from the APOC Procedures library to perform this as batch updates. Something like this:
CALL apoc.periodic.iterate("
MATCH (:TagClass {name: 'Single'})<-[:HAS_TYPE]-(:Tag)<-[:HAS_TAG]-(message:Message)
MATCH (message)-[:IS_LOCATED_IN]->(:Country)-[:IS_PART_OF]->(continent:Continent)
RETURN message, continent",
"MERGE (message)-[:BI_24_message_continent]->(continent)", {}) YIELD batches, total, errorMessages
RETURN batches, total, errorMessages
All the sessions of the conference are now available online