# GC Monitoring in M3 Mode (monitorGC)

In the default M3 mode, yCrash monitors core runtime indicators of the target application, such as CPU utilization, memory usage, application logs, response time, and application health checks. These metrics provide a balanced and stable view of the application's overall health.

For environments that require deeper diagnostic visibility, GC log monitoring can be enabled using the monitorGC system property. Garbage Collection logs provide detailed insights into memory allocation patterns, GC throughput, pause times, and overall memory behavior. This additional level of monitoring can be highly valuable during performance investigations or while diagnosing memory-related issues.

However, it is important to note that GC activity can naturally fluctuate even during normal application behavior. When GC monitoring is enabled, yCrash may report incidents for minor instabilities or short-lived fluctuations that are otherwise acceptable in certain environments. If a large number of low-impact incidents are generated, the overall sensitivity and usefulness of the dashboard reports may be reduced due to increased noise.

If this level of detailed monitoring is acceptable for your environment, you may enable GC analysis by setting the following system property:

# Configuration Details

By default monitorGC property will be disabled. To enable this property, add it in launch scripts when starting your application.

  • If you are running the yCrash server on Linux/MAC, open launch-yc-server.sh.
  • If you are running the yCrash server on Windows, open launch-yc-server.bat.

Your launch script would look something like this:

java -Xms2g -Xmx4g -DlogDir=. -DuploadDir=. -DmonitorGC=true
1

This command configures the application to monitor GC logs.

# Disabling the Property

If GC log monitoring is not required, the property can be omitted or set to false:

java -Xms2g -Xmx4g -DlogDir=. -DuploadDir=. -DmonitorGC=false
1

This reverts the application to its default behavior and captures macrometrics.

# When to Enable monitorGC?

Enable this property when:

  • You need detailed memory behavior analysis

  • You are troubleshooting memory leaks or GC pauses

  • You want aggressive micro-metrics monitoring

You may choose not to enable it when:

  • Minor GC fluctuations are acceptable

  • You prefer a cleaner dashboard with fewer low-impact incidents

  • You want only high-level stability monitoring