How to get heap usage using jstat?

后端 未结 1 611
Happy的楠姐
Happy的楠姐 2021-01-04 22:14

I\'m running jstat -gc (from OpenJDK):

# jstat -gc 1
 S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CC         


        
相关标签:
1条回答
  • 2021-01-04 22:50

    See https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html for general reference.

    Current heap size would be the sum of all the fields that end with "C" - S0C, S1C, EC, OC (except for Metaspace which is the fields that start with "M")

    Used heap would be the sum of all the fields that end with "U" - S0U, S1U, EU, OU (again, except metaspace).

    Note that the "C" values (current) are greater than or equal to "U" values (actually used).

    To get maximum values run jstat with the -gccapacity flag and add up all the fields that end with "MX" (NGCMX, OGCMX, ... except for MCMX which is metaspace).

    0 讨论(0)
提交回复
热议问题