8068589: GCCause should distinguish jcmd GC.run from System.gc()
authorysuenaga
Wed, 04 Feb 2015 22:21:08 +0900
changeset 28836 d9c497544bf3
parent 28835 2e467a95d04c
child 28837 fda2ab610119
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
hotspot/src/share/vm/gc_interface/gcCause.cpp
hotspot/src/share/vm/gc_interface/gcCause.hpp
hotspot/src/share/vm/services/diagnosticCommand.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";
 
--- 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
   };
 
--- 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.");
   }