英文:
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
专注分享java语言的经验与见解,让所有开发者获益!
评论