Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In jstat, YGC and FGC count young and full garbage-collection events; YGCT, FGCT, and GCT are cumulative time spent on those collections. Compare consecutive samples to see whether an event occurred between them. Use -gcutil for utilization percentages, -gc for capacities and usage in KB, and -gccause to include reported collection causes.

What jstat reports

Oracle describes jstat as a command that displays performance statistics for an instrumented Java HotSpot VM. The fields discussed here are from the Java SE 17 reference; available fields and their semantics can vary with the target JDK and collector, so consult the man page for the JDK you are monitoring. Oracle Java SE 17 jstat reference.

For percentage-oriented samples, run jstat -gcutil <vmid> <interval-ms> <count>. For capacity and usage values in KB, use jstat -gc <vmid> <interval-ms> <count>. In both outputs, the GC counters and times are cumulative.

Percentage fields in -gcutil

  • S0 and S1: survivor-space utilization percentages.
  • E: eden utilization percentage.
  • O: old-space utilization percentage.
  • M: metaspace utilization percentage.
  • CCS: compressed-class-space utilization percentage.

Capacity and usage fields in -gc

  • S0C/S1C and S0U/S1U: survivor-space capacities and usage.
  • EC/EU: eden capacity and usage.
  • OC/OU: old-space capacity and usage.
  • MC/MU: metaspace committed size and utilization.
  • CCSC/CCSU: compressed-class-space committed size and used space.

The -gc output also includes YGC, YGCT, FGC, FGCT, and GCT.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to identify a collection between samples

Read adjacent rows together. A counter increase means the corresponding event occurred during the interval between those samples; the difference in the time counter is the additional cumulative GC time recorded over that interval.

  • YGC increases: one or more young-generation collections occurred. The change in YGCT is the added young-GC time.
  • FGC increases: one or more full collections occurred. The change in FGCT is the added full-GC time.
  • GCT is cumulative total GC time; subtract adjacent values to see the added total time over the interval.

For example, if YGC rises from 7 to 8 and YGCT rises from 0.300 to 0.378 seconds, one young collection occurred between those rows and the cumulative young-GC time increased by 0.078 seconds. These are illustrative values from Oracle’s Java SE 17 example, not a performance target or threshold.

Rank #2

What -gccause adds

Run jstat -gccause <vmid> <interval-ms> <count> to get the -gcutil summary plus two cause fields: LGCC, the cause of the last GC, and GCC, the cause of the current GC when applicable. Causes can help explain why a collection was reported, but interpret them alongside counter changes and occupancy; a cause field does not replace the event counts or time deltas.

Why old-space utilization can rise after a young collection

A young collection can reduce eden utilization, change survivor-space occupancy, and promote surviving objects into old space. Promotion is why old-space utilization may rise across a young-GC event rather than fall. In Oracle’s Java SE 17 worked example, eden rises from 70.31% to 96.53%, then falls to 1.98% after a collection; YGC advances from 7 to 8, YGCT from 0.300 to 0.378 seconds, survivor utilization changes, and old-space utilization rises from 66.80% to 68.19%. This illustrates one run and collector, not a universal pattern or evidence by itself of a problem. Oracle’s jstat examples.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Useful sampling controls

A typical command specifies the VM identifier followed by an optional sampling interval in milliseconds and count. For example, jstat -gcutil 21891 250 7 samples the VM identified as 21891 at 250-millisecond intervals for seven samples.

  • Add -t to prepend a timestamp to each sample.
  • Add -h N to repeat the column header every N lines, which can make longer output easier to read.

When new-generation detail matters

Use jstat -gcnew <vmid> <interval-ms> <count> when you need additional young-generation details. Alongside survivor and eden capacities and usage, it reports YGC and YGCT plus:

  • TT: current tenuring threshold.
  • MTT: maximum tenuring threshold.
  • DSS: desired survivor size.

Oracle’s example shows TT falling when survivor demand would exceed DSS, then returning when survivor pressure is low. That example describes a particular collector and run; it is not a universal threshold rule.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to compare two runs fairly

For a useful comparison, keep the sampling interval, JDK version, collector, and workload constant. Then compare the same signals rather than isolated end-of-run values:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Event frequency: compare changes in YGC and FGC over the same observation period.
  • Time accumulation: compare YGCT, FGCT, and GCT deltas over that period.
  • Post-event occupancy: inspect E, O, S0, and S1 in rows after counter changes.
  • Reported causes: review LGCC and GCC from -gccause, where available.

A difference in counters or occupancy is a clue to investigate, not by itself proof that a configuration change caused a performance improvement or regression.

Quick Recap

Bestseller No. 2
Java Performance Tuning (2nd Edition)
Java Performance Tuning (2nd Edition)
Used Book in Good Condition
$19.60
SaleBestseller No. 3
SaleBestseller No. 5

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.