jstat – jvm memory stats

/usr/java/jdk1.5.0_22/bin/jstat -gcutil 18703 1s 10

gcutil = Summary of Garbage Collection Statistics (mandatory)
18703 = process id (mandatory)
1s = refresh interval (optional)
10 = counter (optional)

$ /usr/java/jdk1.5.0_22/bin/jstat -gcutil 25532 1s 10
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
  0.00   0.00  71.36  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  72.22  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  78.39  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  88.32  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  93.77  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  97.66  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00   1.90  36.45  72.25     40    6.357     1    0.440    6.797
  0.00   0.00   6.94  36.45  72.25     40    6.357     1    0.440    6.797
  0.00   0.00   9.40  36.45  72.25     40    6.357     1    0.440    6.797
  0.00   0.00   9.57  36.45  72.25     40    6.357     1    0.440    6.797

event during the 6th and the 7th sample
collection took 0.162s (6.357s-6.195s)
increasing utilization (0.86%) of old space