Neo4J 在 EC2 上的 AWS,java.lang.OutOfMemoryError: Java 堆空间错误 — 如何修复?

huangapple 未分类评论46阅读模式
英文:

Neo4J on EC2 AWS java.lang.OutOfMemoryError: Java heap space error — How to fix?

问题

Neo4J 3.3.4正在运行在EC2 t3.medium AWS实例上,具有2个vCPUs和4GB RAM。由于是通过AWS AMI Neo4J映像启动的,它通过systemctl运行。

有时候在需求过高的情况下,它会停顿,虽然在debug.log中没有任何信息,但如果我输入systemctl status neo4j,我会看到以下错误:

Jul 25 18:55:14 ip-x-x-x-x pre-neo4j.sh[5493]: Exception in thread "qtp1269774727-33" java.lang.OutOfMemoryError: Java heap space

我该如何检测这种错误并在这种情况下重新启动数据库?

是否有可能通过调整/etc/neo4j/neo4j.template中的设置来完全避免这种情况?

我尝试了默认的注释以及下面的设置,但效果并不明显。如何解决这个问题?

dbms.memory.heap.initial_size=1996m
dbms.memory.heap.max_size=1996m
dbms.memory.pagecache.size=1g
英文:

Neo4J 3.3.4 is running on EC2 t3.medium AWS instance with 2 vCPUs and 4Gb RAM. As it is launched through the AWS AMI Neo4J image it runs through systemctl.

Sometimes when the demand is too high it stalls and while there is no information in debug.log if I type in systemctl status neo4j I see the following error:

Jul 25 18:55:14 ip-x-x-x-x pre-neo4j.sh[5493]: Exception in thread "qtp1269774727-33" java.lang.OutOfMemoryError: Java heap space

How can I detect this sort of error and relaunch the database in that case?

Is it possible to avoid it at all by tweaking the settings in /etc/neo4j/neo4j.template ?

I used both the default commented out and those below but this didn't really have any positive effect. How to fix that?

dbms.memory.heap.initial_size=1996m
dbms.memory.heap.max_size=1996m
dbms.memory.pagecache.size=1g

huangapple
  • 本文由 发表于 2020年7月26日 03:44:26
  • 转载请务必保留本文链接:https://java.coder-hub.com/63092830.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定