What is Garbage collection and why enabling it?
A garbage collection event is a complete pause of the java application (ie: neo4j-server).
It can be identified in the debug.log as a
If you notice issues with them such as too many pauses, too long of a pause, pauses causing cluster re-election, etc, you can enabling GC logging for easier integration with monitoring parsers.
Keep in mind the following regarding GC logging:
- GC log files are cleared out when the database is restarted
- They are crucial for the analysis of the Application Performance
- It will add minor overhead
- You might consider enabling this option on your live environments
Enabling GC logging
Save the file and restart your server.
GC log location
The log file will be written to the logs directory as specified
here and named
dbms.gc.log.options differs due to the upgrade from Java 8 to 11 in 4.0.x.
We recommend to leave this commented so neo4j starts with working settings in both versions.
You can review those differences in the table below.
#dbms.logs.gc.options=-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+PrintTenuringDistribution