# HG changeset patch # User johnc # Date 1337100558 25200 # Node ID 1096fc5a52ebf7be017bb63bc3aa428ad57ae0cd # Parent 33e36660990453fbff4955787d95a4051acf6259 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 diff -r 33e366609904 -r 1096fc5a52eb src/share/vm/gc_implementation/g1/vm_operations_g1.cpp --- a/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp Mon May 14 21:07:28 2012 -0700 +++ b/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");