Java Garbage Collection (gc) pauses are monitored by the MonitorGc process in Neo4j, and recorded in the $NEO4J_HOME/logs/debug.log (
or $NEO4J_HOME/data/graph.db/messages.log for Neo4j v2.3.x and prior). To quickly find the 10 longest pauses in Neo4j 3.x and above, one can run:
The example grep command will perform a case-insensitive search (as a result of the -i argument) of the debug.log for the string
'blocked' and return the respective line number (as a result of the -n argument). These results are then sorted by way of the 11th field
(as a result of -k 11) and sorted in numeric order rather than ASCII order (as a result of the -n argument) and then presented in
reverse chronological order (as a result of the -r argument). Lastly the head -10 will only display the top 10 results after the sort.