Garbage Collection

Relative time spent in GC and the number of surviving generations

The Memory tab in the VM Telemetry tab provides the following information on garbage collection in the application.

  • Relative time. Relative time is measured as a percentage of the total execution time that the target JVM spends running garbage collection with all application threads suspended.
  • Surviving generations. This represents the number of different ages for all objects allocated on the JVM heap since the moment Profiler was attached to it.
  • Age of object. The age of the object is measured as the number of garbage collections survived

A steady growth of this number usually indicates that some objects are leaking. On the other hand, if this metrics stabilizes and does not grow noticeably thereafter, it's guaranteed that your application does not have any growing memory leaks.

This may be valuable information if you observe memory usage going up. In such situations, people usually start to suspect a memory leak. However, if you observe that in this case the number of surviving generations remains stable, it is very likely that the root of the problem is not a memory leak, but some other problem.

One example is a growing number of concurrent threads, each of which allocates a large amount of memory for a very short time. In that case, you may observe gradual increase in the memory usage, which may ultimately cause an out of memory error. However, there is no leak, since each thread releases its allocated objects quickly, and memory recycling rate is in fact quite high.

Note that for technical reasons this monitor does not work when your target JVM uses the Concurrent Mark and Sweep garbage collector. This is the garbage collector that is activated using the -XX:+UseConcMarkSweepGC or -Xconcgc JVM command line option.

See also



Project Features

About this Project

Profiler was started in November 2009, is owned by Tomas Hurka, and has 58 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
Please Confirm