【问题标题】:OutOfMemoryError: Java heap space in Neo4jOutOfMemoryError:Neo4j 中的 Java 堆空间
【发布时间】:2019-02-09 10:55:48
【问题描述】:

我正在尝试从连接的表中检索所有字段。结果的大小应该是 5893886 条记录。每次我尝试使用适用于 Scala 的 Neo4j 驱动程序运行此查询时,都会出现这种错误:

Exception in thread "dispatcher-event-loop-4" *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message can't create byte array at JPLISAgent.c line: 813
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message can't create byte array at JPLISAgent.c line: 813
java.lang.OutOfMemoryError: Java heap space

我应该如何优化我的查询或调整设置来修复这个错误? 我的查询如下所示:

MATCH (m:Member)-[mg_r:PARTICIPATE_IN]->(g:Group)
RETURN m.member_id, m.member_join_id, m.bio, m.city, m.country,
  m.joined, m.lat, m.link, m.lon, m.member_name, m.state,
  m.member_status, m.visited, m.group_id, g.group_id, g.category_id,
  g.category_name, g.city_id, g.city, g.country, g.created, g.join_mode,
  g.lat, g.link, g.lon, g.members, g.rating

此外,Neo4j conf 文件内容看起来是这样的:

dbms.allow.upgrade=true
dbms.allow.format.migration=true
dbms.security.allow.csv.import.from.file.urls=true
wrapper.java.additional=-Dneo4j.ext.udc.source=docker
ha.host.data=350d989e7781:6001
ha.host.coordination=350d989e7781:5001
dbms.tx_log.rotation.retention_policy=100M size
dbms.memory.pagecache.size=512M
dbms.memory.heap.max_size=1024M
dbms.memory.heap.initial_size=1024M

【问题讨论】:

    标签: neo4j jvm heap-memory neo4j-apoc


    【解决方案1】:

    您正在尝试执行的查询需要比 Neo4j 提供的更多 RAM。因此您需要增加堆大小。

    你能试试这个 Neo4j 设置吗:

    dbms.memory.heap.max_size=2048M
    dbms.memory.heap.initial_size=2048M
    

    干杯

    【讨论】:

      猜你喜欢
      • 2021-09-09
      • 2016-04-17
      • 1970-01-01
      • 2011-10-27
      • 2011-05-03
      • 2014-04-13
      • 2011-12-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多