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
This commit is contained in:
Stefan Johansson 2014-10-30 10:51:06 +01:00
parent 76db8ade45
commit 6306dce831
3 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -644,10 +644,13 @@ class CollectedHeap : public CHeapObj<mtInternal> {
// 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 ///////////////