Java Monitoring

How to monitor java process using console

https://docs.oracle.com/javase/9/tools/monitoring-tools-and-commands.htm#JSWOR732

jps

jstat

Options:

[root@mplmas2 cron]$ jstat -options
-class
-compiler
-gc
-gccapacity
-gccause
-gcmetacapacity
-gcnew
-gcnewcapacity
-gcold
-gcoldcapacity
-gcutil
-printcompilation

jstat -class [PID]
ps -ef -u USER|grep  tomcat|grep user|tr -s " "|cut -d" " -f 2

jstat -class 2490
Loaded Bytes Unloaded Bytes Time 
20012 39398.8 196 288.9 41.26
jstat -class 2490
jstat -compiler 2490
jstat -gc 2490
jstat -gccapacity 2490
jstat -gccause 2490
jstat -gcmetacapacity 2490
jstat -gcnew 2490
jstat -gcnewcapacity 2490
jstat -gcold 2490
jstat -gcoldcapacity 2490
jstat -gcutil 2490
jstat -printcompilation 2490

Leave a Reply

Your email address will not be published. Required fields are marked *