--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2015-02-11 22:34:19.177474400 +0900 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2015-02-11 22:34:18.422474400 +0900 @@ -2252,6 +2252,7 @@ switch (cause) { case GCCause::_gc_locker: return GCLockerInvokesConcurrent; case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent; + case GCCause::_dcmd_gc_run: return ExplicitGCInvokesConcurrent; case GCCause::_g1_humongous_allocation: return true; case GCCause::_update_allocation_context_stats_inc: return true; case GCCause::_wb_conc_mark: return true; --- old/src/share/vm/gc_interface/gcCause.cpp 2015-02-11 22:34:20.303474400 +0900 +++ new/src/share/vm/gc_interface/gcCause.cpp 2015-02-11 22:34:20.183474400 +0900 @@ -103,6 +103,9 @@ case _last_ditch_collection: return "Last ditch collection"; + case _dcmd_gc_run: + return "Diagnostic Command"; + case _last_gc_cause: return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE"; --- old/src/share/vm/gc_interface/gcCause.hpp 2015-02-11 22:34:20.961474400 +0900 +++ new/src/share/vm/gc_interface/gcCause.hpp 2015-02-11 22:34:20.668474400 +0900 @@ -74,6 +74,9 @@ _g1_humongous_allocation, _last_ditch_collection, + + _dcmd_gc_run, + _last_gc_cause }; --- old/src/share/vm/memory/genCollectedHeap.cpp 2015-02-11 22:34:21.537474400 +0900 +++ new/src/share/vm/memory/genCollectedHeap.cpp 2015-02-11 22:34:21.376474400 +0900 @@ -322,9 +322,16 @@ } bool GenCollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { - return UseConcMarkSweepGC && - ((cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) || - (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent)); + if (!UseConcMarkSweepGC) { + return false; + } + + switch (cause) { + case GCCause::_gc_locker: return GCLockerInvokesConcurrent; + case GCCause::_java_lang_system_gc: + case GCCause::_dcmd_gc_run: return ExplicitGCInvokesConcurrent; + default: return false; + } } void GenCollectedHeap::do_collection(bool full, --- old/src/share/vm/services/diagnosticCommand.cpp 2015-02-11 22:34:22.195474400 +0900 +++ new/src/share/vm/services/diagnosticCommand.cpp 2015-02-11 22:34:21.978474400 +0900 @@ -267,7 +267,7 @@ void SystemGCDCmd::execute(DCmdSource source, TRAPS) { if (!DisableExplicitGC) { - Universe::heap()->collect(GCCause::_java_lang_system_gc); + Universe::heap()->collect(GCCause::_dcmd_gc_run); } else { output()->print_cr("Explicit GC is disabled, no GC has been performed."); }