Metronome Garbage Collector behavior on explicit System.gc() calls (AIX, Linux only)

If a garbage collection cycle is in progress, the Metronome Garbage Collector completes the cycle in a synchronous way when System.gc() is called. If no garbage collection cycle is in progress, a full synchronous cycle is performed when System.gc() is called. Use System.gc() to clean up the heap in a controlled manner. It is a nondeterministic operation because it performs a complete garbage collection before returning.

Some applications call vendor software that has System.gc() calls where it is not acceptable to create these nondeterministic delays. To disable all System.gc() calls use the -Xdisableexplicitgc option.

The verbose garbage collection output for a System.gc() call has a reason of system garbage collect and is likely to have a long duration:

<gc-op id="9" type="syncgc" timems="6.439" contextid="8" timestamp="2011-07-12T09:41:40.808">
  <syncgc-info reason="VM shut down" exclusiveaccessTimeMs="0.009" threadPriority="11"/>
  <free-mem-delta type="heap" bytesBefore="126082300" bytesAfter="156085440"/>
  <classunload-info classloadersunloaded="14" classesunloaded="276"/>
  <references type="soft" cleared="154" dynamicThreshold="29" maxThreshold="32"/>
  <references type="weak" cleared="53"/>
  <finalization enqueued="34"/>
</gc-op>