-Xcompactgc / -Xnocompactgc
Enables or disables full compaction on system and global garbage collection (GC) activities.
||Enable full compaction|
||Disable full compaction|
If a compaction option is not specified, the garbage collector compacts based on a series of triggers. These triggers attempt to compact only when it is beneficial to the future performance of the VM.
These options are not applicable to the following GC policies:
- balanced GC policy (
-Xgcpolicy:balanced): compaction is always enabled.
- metronome GC policy (
-Xgcpolicy:metronome): compaction is not supported.