What Do The Surviving Generations Metrics Mean?

In VM Telemetry graphs of the Profiler you can see Surviving Generations metrics which can detect potential memory leaks. Here's a three-lines definition of the what the metrics mean:

  • a Generation is a set of instances created within the same GC interval (between two garbage collections)
  • a Surviving Generation is a Generation that survives at least one garbage collection. The number of survived garbage collections - the generation's age - is its unique identifier
  • Surviving Generations (metrics) value is the number of differerent Surviving Generations that are currently alive on the heap (number of Generations with different generation ages)

Typically there are several long-lived objects (like an application's main JFrame etc.) in an application representing one or a few Surviving Generations. There are also many short-lived objects created very frequently (such as Dimension etc.) and released soon, typically within only a few garbage collections. They also represent just several Surviving Generations.

After some period of time the number of Surviving Generations in an application should become stable because all long-lived objects have already been created and newly-created short-lived objects are periodically being released from the heap. However, if there is a memory leak in an application which prevents newly-created objects from being released from the heap (for example objects stored in a Collection and never removed), the number of Surviving Generations grows and that's exactly what the Surviving Generations metrics is able to detect regardless of how much memory is wasted by such a leak.

Note: This is an excerpt from an article published at netbeans.org. You can read the full story with a simple four-steps tutorial here.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

A blog by NetBeans Profiler & VisualVM developers.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today