mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
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:
parent
76db8ade45
commit
6306dce831
3 changed files with 8 additions and 4 deletions
|
@ -1248,7 +1248,7 @@ public:
|
||||||
// The same as above but assume that the caller holds the Heap_lock.
|
// The same as above but assume that the caller holds the Heap_lock.
|
||||||
void collect_locked(GCCause::Cause cause);
|
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,
|
jlong* totals,
|
||||||
jbyte* accuracy,
|
jbyte* accuracy,
|
||||||
jint len);
|
jint len);
|
||||||
|
|
|
@ -25,8 +25,9 @@
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc_implementation/g1/g1CollectedHeap.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,
|
jlong* totals,
|
||||||
jbyte* accuracy,
|
jbyte* accuracy,
|
||||||
jint len) {
|
jint len) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -644,10 +644,13 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
||||||
// For each context in contexts, set the corresponding entries in the totals
|
// For each context in contexts, set the corresponding entries in the totals
|
||||||
// and accuracy arrays to the current values held by the statistics. Each
|
// and accuracy arrays to the current values held by the statistics. Each
|
||||||
// array should be of length len.
|
// 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,
|
jlong* totals,
|
||||||
jbyte* accuracy,
|
jbyte* accuracy,
|
||||||
jint len) { }
|
jint len) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////// Unit tests ///////////////
|
/////////////// Unit tests ///////////////
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue