OutOfMemoryError:Neo4j中的Java堆空间

问题描述 投票:0回答:1

我试图从连接表中检索所有字段。结果的大小应该是5893886条记录。每次我尝试使用Neo4j驱动程序为Scala运行此查询时,我都会收到此类错误:

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个回答
0
投票

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

你能尝试这个Neo4j设置:

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

干杯

© www.soinside.com 2019 - 2024. All rights reserved.