When investigating the cause of long garbage collection cycles, it is often useful to enable GC logging.

You can do so by following the product documentation.

Once this is enabled, you can look through the GC log file for signs of problems.

When looking for Full GC messages, pay special attention to the details of the message.

If you see something like:

2019-05-02 17:53:16.622+0100 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=566, gcTime=596, gcCount=1}

In this case you are likely looking at a situation where the application code is invoking a full garbage collection cycle, whether or not it is needed. It is recommended to allow the JVM to make decisions on how and when to run garbage collection.

Do not to explicitly trigger “stop the world” events by calling System.gc().

Details


Author:
Dave Gordon
Applicable versions:
3.0,3.1,3.2,3.3,3.4,3.5
Keywords:
garbage collectionheapJVMloggingmemoryneo4j-3.0neo4j-3.1neo4j-3.2neo4j-3.3neo4j-3.4neo4j-3.5operations