How to Force Java Garbage Collection from CLI - Quick and Dirty September 4, 2024 If you run jmap -histo:live <pid>, that will force a full GC on the heap before it prints anything out. source: https://stackoverflow.com/a/3524024