Article DetailsDetailsHelp Details What is Garbage collection and why enable 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 stop-the-world event. For example: If you notice issues with them such as too many pauses, too long of a pause, pauses causing cluster re-election, etc, you can enable 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 restartedThey are crucial for the analysis of the Application's PerformanceIt will add minor overheadYou might consider enabling this option on your live environments Enabling GC logging GC logging is enabled by adding the following configuration to neo4j.conf Neo4j 4.x and below Either uncomment or add the following line: dbms.logs.gc.enabled=true Save the file and restart your server. Neo4j 5.x & Neo4j 202X.X.X Either uncomment or add the following line: server.logs.gc.enabled=true 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 gc.log.<#> Include timestamp in GC log If you'd like to have a full timestamp in the GC log, rather than just the default JVM elapsed time, please see the specific knowledge article: https://support.neo4j.com/s/article/4402981671187-Include-timestamp-in-GC-log Additional options You can review our operational manual (3.5 or newer) for additional settings such as the number of rotated files or their size. dbms.gc.log.options changes dbms.gc.log.options differs due to the upgrade from Java 8 to 11 in 4.0.x. We recommend leaving this commented out so Neo4j starts with working settings in both versions. You can review those differences in the table below: Differences between 3.5.x, 4.x, 5.x neo4j version configuration value 3.5.x dbms.logs.gc.options=-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+PrintTenuringDistribution 4.x dbms.logs.gc.options=-Xlog:gc*,safepoint,age*=trace 5.x & 202X.X.X server.logs.gc.options=Xlog:gc*,safepoint,age*=trace InformationTitleEnabling GC Logging in Neo4jArticle Created Date3/15/2024, 10:55 PMURL Name204225303-Enabling-GC-Logging-in-Neo4jLast Modified Date12/9/2025, 10:17 AM