I'm gonna execute jcmd $PID GC.class_stats -csv=true
command on my tomcat process, to get loaded class status.
I worry about the command effect to tomcat process, like creating heap dump.
Can cause stop the world or the other effect when execute the command?
I can't find about it.
thanks.
Yes,
GC.class_stats
is a high overhead diagnostic command, and it runs in a global safepoint (STW pause). Among other things, this operation walks through the whole heap to compute memory consumed by all instances of all loaded classes.Furthermore, the operation causes Full GC. See the source code:
jcmd <pid> help GC.class_stats
also warns that the command has high impact on the VM:By the way,
GC.class_stats
has been removed in JDK 15.