Reputation: 649
I think I need help on Neo4j (Graph database)
I have medium size data (~300 json objects) in JSON file (~250MB). I have to create graph database by using this file.
But I got this an exception:
Exception in thread "qtp2007561282-66" Exception in thread "neo4j.TransactionTimeoutMonitor-29" Exception in thread "neo4j.FileIOHelper-12" Exception in thread "neo4j.IndexSampling-17" Exception in thread "neo4j.FileIOHelper-20" 2021-06-27 03:44:06.265+0000 WARN Java heap space java.lang.OutOfMemoryError: Java heap space Exception in thread "neo4j.StorageMaintenance-28" Exception in thread "pool-1-thread-1" Exception in thread "neo4j.FileIOHelper-4" Exception in thread "qtp2007561282-65" 2021-06-27 03:44:06.280+0000 WARN Java heap space java.lang.OutOfMemoryError: Java heap space Exception in thread "neo4j.FileIOHelper-18" 2021-06-27 03:44:06.293+0000 WARN Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space 2021-06-27 03:44:06.416+0000 ERROR Unexpected error detected in bolt session 'bolt-16'. Could not initialize class org.apache.commons.lang3.exception.ExceptionUtils java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.lang3.exception.ExceptionUtils
My Cipher SQL query is something like that:
with "file:///data.json" as url
call apoc.load.json(url)
yield value
merge (c:Company {register: value.info.register_number})
on create set c.name = value.info.company_name,
c.form = value.info.company_form,
c.register_date = value.info.register_date,
c.type = value.info.company_type,
c.number_of_owners = value.info.number_of_owner,
c.location = value.info.company_location
foreach (holder in value.stakeHolders |
merge (p:Person {person_id : holder.firstname + "." + holder.lastname})
on create set p.firstname = holder.lastname,
p.lastname = holder.firstname,
p.country = holder.country
create (holder1:RegisterDate {date: holder.date})
merge (p)-[:has]->(holder1)-[:holder_of]->(c)
)
foreach (manager in value.ceo |
merge (m:Person {person_id: manager.lastname + "." + manager.firstname})
on create set m.firstname = manager.firstname,
m.lastname = manager.lastname,
m.country = manager.country
create (manager1:RegisterDate {
position: manager.position,
date: manager.date
})
merge (m)-[:has]->(manager1)-[:has_position]->(c)
)
foreach (area in value.area |
merge (a:ActivityArea {code: area.code})
on create set a.title = area.title
create (area1:RegisterDate {
date: area.date
})
merge (c)-[:has]->(area1)-[:operation]->(a))
What should I do? please help me!
Upvotes: 1
Views: 1566
Reputation: 12684
Increase your jvm heap size in neo4j configuration file found in config folder then do a restart.
file: <neo4j-home>/conf/neo4j.conf
Here is the documentation about it. https://neo4j.com/docs/operations-manual/current/configuration/neo4j-conf/#neo4j-conf-JVM
Upvotes: 2