提交 f641d0b3 编写于 作者: S sjohanss

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
上级 ed017d51
...@@ -1249,7 +1249,7 @@ public: ...@@ -1249,7 +1249,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 @@ ...@@ -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;
} }
...@@ -641,10 +641,13 @@ class CollectedHeap : public CHeapObj<mtInternal> { ...@@ -641,10 +641,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 ///////////////
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册