8059466: Force young GC to initiate marking cycle when stat update is requested
authorsjohanss
Mon, 06 Oct 2014 10:11:13 +0200
changeset 27008 10d6c1e39d87
parent 26952 7b9d2d64bbbd
child 27009 e7e723732b6b
8059466: Force young GC to initiate marking cycle when stat update is requested Summary: Enable yc to be forced for stat update. Reviewed-by: mgerdin, jcoomes
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
hotspot/src/share/vm/gc_interface/gcCause.cpp
hotspot/src/share/vm/gc_interface/gcCause.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Oct 03 13:00:21 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Oct 06 10:11:13 2014 +0200
@@ -2343,6 +2343,7 @@
     case GCCause::_gc_locker:               return GCLockerInvokesConcurrent;
     case GCCause::_java_lang_system_gc:     return ExplicitGCInvokesConcurrent;
     case GCCause::_g1_humongous_allocation: return true;
+    case GCCause::_update_allocation_context_stats_inc: return true;
     default:                                return false;
   }
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Fri Oct 03 13:00:21 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Mon Oct 06 10:11:13 2014 +0200
@@ -95,8 +95,9 @@
   assert(!_should_initiate_conc_mark ||
   ((_gc_cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||
    (_gc_cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent) ||
-    _gc_cause == GCCause::_g1_humongous_allocation),
-         "only a GC locker, a System.gc() or a hum allocation induced GC should start a cycle");
+    _gc_cause == GCCause::_g1_humongous_allocation ||
+    _gc_cause == GCCause::_update_allocation_context_stats_inc),
+      "only a GC locker, a System.gc(), stats update or a hum allocation induced GC should start a cycle");
 
   if (_word_size > 0) {
     // An allocation has been requested. So, try to do that first.
--- a/hotspot/src/share/vm/gc_interface/gcCause.cpp	Fri Oct 03 13:00:21 2014 +0200
+++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp	Mon Oct 06 10:11:13 2014 +0200
@@ -54,7 +54,8 @@
     case _wb_young_gc:
       return "WhiteBox Initiated Young GC";
 
-    case _update_allocation_context_stats:
+    case _update_allocation_context_stats_inc:
+    case _update_allocation_context_stats_full:
       return "Update Allocation Context Stats";
 
     case _no_gc:
--- a/hotspot/src/share/vm/gc_interface/gcCause.hpp	Fri Oct 03 13:00:21 2014 +0200
+++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp	Mon Oct 06 10:11:13 2014 +0200
@@ -47,7 +47,8 @@
     _heap_inspection,
     _heap_dump,
     _wb_young_gc,
-    _update_allocation_context_stats,
+    _update_allocation_context_stats_inc,
+    _update_allocation_context_stats_full,
 
     /* implementation independent, but reserved for GC use */
     _no_gc,