changeset 7794:5abc906fe3a8

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
author ysuenaga
date Wed, 04 Feb 2015 22:21:08 +0900
parents ea729fe8efd9
children 0d44a3fdbe02
files src/share/vm/gc_interface/gcCause.cpp src/share/vm/gc_interface/gcCause.hpp src/share/vm/services/diagnosticCommand.cpp
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_interface/gcCause.cpp	Tue Feb 03 15:50:06 2015 +0100
+++ b/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/src/share/vm/gc_interface/gcCause.hpp	Tue Feb 03 15:50:06 2015 +0100
+++ b/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/src/share/vm/services/diagnosticCommand.cpp	Tue Feb 03 15:50:06 2015 +0100
+++ b/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.");
   }