From 6306dce8314bc82d7bf3cb7a3b3a53ff7440ed2f Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Thu, 30 Oct 2014 10:51:06 +0100 Subject: [PATCH] 8061234: ResourceContext.requestAccurateUpdate() is unreliable Changing copy_allocation_context_stats to return if there are more stats available after the copy. Reviewed-by: rriggs, jcoomes --- .../src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp | 2 +- .../share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp | 3 ++- hotspot/src/share/vm/gc_interface/collectedHeap.hpp | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index f1aaceaacb4..e7ff5d4b016 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -1248,7 +1248,7 @@ public: // 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/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp index 401b28b6fee..7f71451b6ca 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp +++ b/hotspot/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/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index ea2dcc9a54b..bbd778c3463 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -644,10 +644,13 @@ class CollectedHeap : public CHeapObj { // 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 ///////////////