Last active
June 22, 2020 23:47
-
-
Save dcapwell/3b2d3edb68514b828f94 to your computer and use it in GitHub Desktop.
Java JVM monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html | |
# eden (free), old (free), young GC time, # full GC, full GC time, total GC time | |
jstat -gc -h10 $(jps -m | grep <process name here> | awk '{print $1}') 1000 0 | awk '/^[0-9]/ {printf "%-10s %-10s %-10s %-10s %-10s %-10s\n", int((100*$6)/$5), int((100*$8)/$7), $(NF-3), $(NF-2), $(NF-1), $NF}' | |
# OR | |
pid=42 | |
jstat -gc -h10 $pid 1000 0 | awk '/^ [0-9]/ {printf "%-10s %-10s %-10s %-10s %-10s %-10s\n", int((100*$6)/$5), int((100*$8)/$7), $(NF-3), $(NF-2), $(NF-1), $NF}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment