Heap in use after the GC event

Current maximum heap size

Duration of the GC event

To capture basic -Xloggcdata, use the following command:

$ java ... -Xloggc:filename

More data are available if you start the JVM with the -XX:+PrintGCDetailsor -XX:+PrintHeapAtGCoptions. For example, you can type:

$ java ... -XX:+PrintGCDetails -Xloggc:filename

Use these additional options to obtain more data on GC activity in the eden space, the survivor space, the old generation, and the permanent generation.

NOTE:

Using -XX:+PrintGCDetails and -XX:+PrintHeapAtGC Together

Some JVMs improperly mix the output from these two options, resulting in a data file that cannot be parsed properly by HPjmeter. We recommend using only one of the two options.

To see the availability in HPjmeter of metrics derived from -Xloggcdata, see -Xverbosegc and -Xloggc Options and Their Corresponding Metrics (page 85).

Naming GC Data Files

The following table shows the file name formats used by default when naming files containing garbage collection data. You may want to follow this convention when naming GC data files, but it is not required.

Table 6-3 Default File Name Suffixes for GC Data

Option

File Name Suffix

 

 

-Xverbosegc

.vgc

 

 

-Xloggc

.vgc

 

 

-Xverbosegc and -Xloggc Options and Their Corresponding Metrics

The following metrics or features are available depending on the option used to collect data.

Table 6-4 Available Metrics from -Xverbosegcand -XloggcGarbage Collection Data

Metric

-Xverbosegc

-Xloggc

 

 

 

Allocation Site Statistics (page 161)

Yes

No

 

 

 

Heap Usage After GC (page 157)

Yes

Yes

 

 

 

Duration (Stop the World) (page 158)

Yes

Yes

 

 

 

Cumulative Allocation (page 159)

Yes

Yes

 

 

 

Creation Rate (page 160)

Yes

Yes

 

 

 

Cumulative GC duration*

Yes

Yes

 

 

 

Heap usage before GC*

Yes

Yes

 

 

 

Heap capacity*

Yes

Yes

 

 

 

Reclaimed bytes*

Yes

Yes

 

 

 

Promoted bytes*

Yes

No

 

 

 

Percentage of Time in GC*

Yes

Yes

 

 

 

-Xverbosegc and -Xloggc Options and Their Corresponding Metrics 85