When I run jcmd PID help GC.heap_dump
, the help clearly says that full GC will be called, unless -all
flag is specified:
GC.heap_dump ... Impact: High: Depends on Java heap size and content. Request a full GC unless the '-all' option is specified. <...>
-all : [optional] Inspect all objects, including unreachable objects (BOOLEAN, false)
If I run jcmd PID help GC.class_histogram
, the help doesn't say anything about forcing a full GC, however "Impact" is still said to be "high", and the option still has an -all
flag, which behaves exactly as for GC.heap_dump
:
GC.class_histogram ... Impact: High: Depends on Java heap size and content.
-all : [optional] Inspect all objects, including unreachable objects (BOOLEAN, false)
I tried to run this command on couple of environments, and full GC was not called. However, since it "Depends on Java heap size and content" I cannot be sure.
So can jcmd PID GC.class_histogram
call a full GC in some circumstances? If yes, what are they?