My Neo4J 3.3.4 that is run on AWS EC2 (using Neo4J AMI image) sometimes stalls with this error and becomes nonresponsive:
Jul 16 23:36:38 ip-xxx pre-neo4j.sh[31810]: Caused by: java.lang.OutOfMemoryError: Java heap space
Jul 16 23:36:38 ip-1xxx pre-neo4j.sh[31810]: java.lang.OutOfMemoryError: Java heap space2020-07-16 23:36:38.993+0000 WARN Error for /db/data/cyphe
Jul 16 23:36:38 ip-xxx pre-neo4j.sh[31810]: java.lang.OutOfMemoryError: Java heap space
Jul 16 23:36:38 ip-xxx pre-neo4j.sh[31810]: java.lang.OutOfMemoryError: Java heap space
Jul 16 23:36:38 ip-xxx pre-neo4j.sh[31810]: java.lang.OutOfMemoryError: Java heap space
Jul 16 23:36:39 ip-xxx pre-neo4j.sh[31810]: 2020-07-16 23:36:39.234+0000 WARN Error for /db/data/transaction/commit Java heap space
Jul 16 23:36:39 ip-xxx pre-neo4j.sh[31810]: java.lang.OutOfMemoryError: Java heap space
In my neo4j.conf I left all the settings for Java memory, heap and pagecache default (commented out).
I'm currently on t3.medium with 2 vCPUs and 4GB RAM, it is dedicated to Neo4J.
Is there any way to detect this and to restart the database?
Is there any way to manually set the settings based on the config above to avoid that?