# HG changeset patch # User ysuenaga # Date 1423056068 -32400 # Node ID d9c497544bf3cc58bbe35db7ffc846626ae341e9 # Parent 2e467a95d04c91ee2fedcd31fa763803aad3ec9e 8068589: GCCause should distinguish jcmd GC.run from System.gc() Summary: GCCause which is caused by GC.run diagnostic command should be different from System.gc() . Reviewed-by: sla, tamao diff -r 2e467a95d04c -r d9c497544bf3 hotspot/src/share/vm/gc_interface/gcCause.cpp --- a/hotspot/src/share/vm/gc_interface/gcCause.cpp Tue Feb 03 15:50:06 2015 +0100 +++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp Wed Feb 04 22:21:08 2015 +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"; diff -r 2e467a95d04c -r d9c497544bf3 hotspot/src/share/vm/gc_interface/gcCause.hpp --- a/hotspot/src/share/vm/gc_interface/gcCause.hpp Tue Feb 03 15:50:06 2015 +0100 +++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp Wed Feb 04 22:21:08 2015 +0900 @@ -74,6 +74,9 @@ _g1_humongous_allocation, _last_ditch_collection, + + _dcmd_gc_run, + _last_gc_cause }; diff -r 2e467a95d04c -r d9c497544bf3 hotspot/src/share/vm/services/diagnosticCommand.cpp --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp Tue Feb 03 15:50:06 2015 +0100 +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp Wed Feb 04 22:21:08 2015 +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."); }