When using the Java low pause Concurrent Mark Sweep (CMS) garbage collector "concurrent mode interrupted" appears in GC logs

Solution Verified - Updated

Environment

  • Java JDK 1.6
  • Concurrent Mark Sweep (CMS) Collector

Issue

The garbage collection logs shows the following:

85030.389: [Full GC 85030.390: [CMS2012-06-20T12:29:58.094+0200: 85030.443: [CMS-concurrent-preclean: 0.108/0.139 secs] [Times: user=0.14 sys=0.01, real=0.14 secs]
 (concurrent mode interrupted): 861863K->904027K(1797568K), 42.9053262 secs] 1045947K->904027K(2047232K), [CMS Perm : 252246K->252202K(262144K)], 42.9070278 secs] [Times: user=43.11 sys=0.18, real=42.91 secs]

What does concurrent mode interrupted mean ?
How do I interpret the logs ?

Resolution

Root Cause

The "concurrent mode failure" message occurs under the following conditions

  1. Is user requested

    • _java_lang_system_gc
    • _jvmti_force_gc
  2. is_serviceability_requested_gc which can be anyone of

    • _jvmti_force_gc
    • _heap_inspection
    • _heap_dump

From the source code snippet (hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp)

  if (PrintGCDetails && first_state > Idling) {
    GCCause::Cause cause = GenCollectedHeap::heap()->gc_cause();
    if (GCCause::is_user_requested_gc(cause) ||
        GCCause::is_serviceability_requested_gc(cause)) {
      gclog_or_tty->print(" (concurrent mode interrupted)");
    } else {
      gclog_or_tty->print(" (concurrent mode failure)");
    }
  }
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.