7168294: G1: Some Full GCs incorrectly report GC cause as "No GC"
authorjohnc
Tue, 15 May 2012 09:49:18 -0700
changeset 12628 bd8e0e8f8e5c
parent 12627 4e01910c3d97
child 12629 cd6a72ba4d23
7168294: G1: Some Full GCs incorrectly report GC cause as "No GC" Summary: GC cause was not being set by the VM_G1CollectForAllocation VM operation. Reviewed-by: jmasa, ysr, brutisso
hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Mon May 14 21:07:28 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Tue May 15 09:49:18 2012 -0700
@@ -42,6 +42,7 @@
 
 void VM_G1CollectForAllocation::doit() {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
+  GCCauseSetter x(g1h, _gc_cause);
   _result = g1h->satisfy_failed_allocation(_word_size, &_pause_succeeded);
   assert(_result == NULL || _pause_succeeded,
          "if we get back a result, the pause should have succeeded");