Skip to content
Monitor the JVM for stop-the-world GC pauses
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


gcwatch is a simple JVM TI agent that monitors stop-the-world garbage collections and makes them available via a simple TCP server interface. This allows detecting if the machine and Java process is still running, even while the normal Java socket operations are blocked by the garbage collection event.


The server returns either OK or GC xxx where xxx is the number of milliseconds since the garbage collection began, followed by a newline.


make JAVA_HOME=/path/to/jdk


Run Java with the agent added as a JVM argument, specifying the port number for the agent to listen on:


Alternatively, if modifying the Java command line is not possible, the above may be added to the JAVA_TOOL_OPTIONS environment variable.

You can’t perform that action at this time.