# HG changeset patch # User sjohanss # Date 1414064384 -7200 # Thu Oct 23 13:39:44 2014 +0200 # Node ID 0dd1a7a1886e34a8040679bc2c8d9fec3b456b6a # Parent 8e15758b2e94e80c3356b933a690284934ef6892 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 --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -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 --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp @@ -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 --git a/src/share/vm/gc_interface/collectedHeap.hpp b/src/share/vm/gc_interface/collectedHeap.hpp --- a/src/share/vm/gc_interface/collectedHeap.hpp +++ b/src/share/vm/gc_interface/collectedHeap.hpp @@ -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 ///////////////