# HG changeset patch # User sjohanss # Date 1414662666 -3600 # Node ID ef9eda2c1abe034a8d0bbcb2dbc7bea678115012 # Parent 678a467a733be54ca3c6ea280fe6ce117600e6ea 8061234: ResourceContext.requestAccurateUpdate() is unreliable Summary: Changing copy_allocation_context_stats to return if there are more stats available after the copy. Reviewed-by: rriggs, jcoomes diff -r 678a467a733b -r ef9eda2c1abe src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue May 27 08:44:23 2014 -0700 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Thu Oct 30 10:51:06 2014 +0100 @@ -1249,7 +1249,7 @@ // The same as above but assume that the caller holds the Heap_lock. void collect_locked(GCCause::Cause cause); - virtual void copy_allocation_context_stats(const jint* contexts, + virtual bool copy_allocation_context_stats(const jint* contexts, jlong* totals, jbyte* accuracy, jint len); diff -r 678a467a733b -r ef9eda2c1abe src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp Tue May 27 08:44:23 2014 -0700 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp Thu Oct 30 10:51:06 2014 +0100 @@ -25,8 +25,9 @@ #include "precompiled.hpp" #include "gc_implementation/g1/g1CollectedHeap.hpp" -void G1CollectedHeap::copy_allocation_context_stats(const jint* contexts, +bool G1CollectedHeap::copy_allocation_context_stats(const jint* contexts, jlong* totals, jbyte* accuracy, jint len) { + return false; } diff -r 678a467a733b -r ef9eda2c1abe src/share/vm/gc_interface/collectedHeap.hpp --- a/src/share/vm/gc_interface/collectedHeap.hpp Tue May 27 08:44:23 2014 -0700 +++ b/src/share/vm/gc_interface/collectedHeap.hpp Thu Oct 30 10:51:06 2014 +0100 @@ -641,10 +641,13 @@ // For each context in contexts, set the corresponding entries in the totals // and accuracy arrays to the current values held by the statistics. Each // array should be of length len. - virtual void copy_allocation_context_stats(const jint* contexts, + // Returns true if there are more stats available. + virtual bool copy_allocation_context_stats(const jint* contexts, jlong* totals, jbyte* accuracy, - jint len) { } + jint len) { + return false; + } /////////////// Unit tests ///////////////