13 Şubat 2023 Pazartesi

jstat komutu - JVM Statistical Monitoring Tool

Giriş
Söz dizimi şöyle
jstat [ generalOption | outputOptions vmid [interval[s|ms] [count]] ]
Seçenekler için açıklama şöyle
jstat is a very powerful JVM monitoring tool, the general usage is:jstat [-options] pid interval

The viewing items it supports are:

-class view class loading information
-compile compile statistics
-gc garbage collection information
-gcXXX Detailed information of GC in each area such as -gcold
Açıklaması şöyle
vmid is the Java virtual machine ID, which is generally the process ID on Linux/Unix systems. 
interval is the sampling interval. 
count is the number of samples. 
-gc seçeneği
Garbage Collection hakkında bilgi verir. Özellikle Kubernetes ortamında herhangi bir araç kurulu değilse işe yarar. Söz dizimi şöyle.
jstat -gc <pid> <time> <amount>
Örnek
Şöyle yaparız. MU metaspace anlamına gelir. 5 MB civarından metaspace kullanıyor
jstat -gc 35118
...
MU
4731.0
Örnek
Açıklaması şöyle
For example, the following output is GC information, the sampling interval is 250ms, and the sampling number is 4:
Şöyle yaparız
# jstat -gc 21711 250 4
 S0C    S1C    S0U    S1U      EC       EU        OC         OU       PC     PU    YGC     YGCT    FGC    FGCT     GCT   
192.0  192.0   64.0   0.0    6144.0   1854.9   32000.0     4111.6   55296.0 25472.7    702    0.431   3      0.218    0.649
192.0  192.0   64.0   0.0    6144.0   1972.2   32000.0     4111.6   55296.0 25472.7    702    0.431   3      0.218    0.649
192.0  192.0   64.0   0.0    6144.0   1972.2   32000.0     4111.6   55296.0 25472.7    702    0.431   3      0.218    0.649
192.0  192.0   64.0   0.0    6144.0   2109.7   32000.0     4111.6   55296.0 25472.7    702    0.431   3      0.218    0.649
-t seçeneği
Örnek
Şöyle yaparız
# pid is 1 in POD, print every 10000 ms
jstat -gc -t 1 10000
S0C    S1C    S0U     S1U      EC      EU        OC         OU        MC      MU    CCSC    CCSU     YGC     YGCT   FGC     FGCT     GCT
512.0  512.0   0.0    32.0  31232.0  18740.0   175104.0    304.1    4864.0  2435.9  512.0   266.9     297    0.591   0      0.000    0.591
512.0  512.0   0.0    64.0  31232.0  19989.0   175104.0    304.1    4864.0  2435.9  512.0   266.9     301    0.591   0      0.000    0.591
512.0  512.0   32.0   0.0   31232.0  4372.6    175104.0    304.1    4864.0  2435.9  512.0   266.9     310    0.603   0      0.000    0.603
512.0  512.0   32.0   0.0   31232.0  13117.7   175104.0    304.1    4864.0  2435.9  512.0   266.9     314    0.609   0      0.000    0.609














Hiç yorum yok:

Yorum Gönder