How do you Force Garbage Collection from the Shell?
Since JDK 7 you can use the JDK command tool 'jcmd' such as:
jcmd <pid> GC.run
If you run jmap -histo:live <pid>
, that will force a full GC on the heap before it prints anything out.
Since JDK 7 you can use the JDK command tool 'jcmd' such as:
jcmd <pid> GC.run
If you run jmap -histo:live <pid>
, that will force a full GC on the heap before it prints anything out.