Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit www.eclipse.org/openj9/docs

-Xcompactgc / -Xnocompactgc

These options enable or disable full compaction on system and global garbage collection (GC) activities.

Syntax

Setting Action
-Xcompactgc Enable full compaction
-Xnocompactgc Disable full compaction

Default behavior

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.

See also