changeset 7364:c85321489672

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
author sjohanss
date Thu, 30 Oct 2014 10:51:06 +0100
parents aec7d1bde45f
children 919536dd73cc
files src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp src/share/vm/gc_interface/collectedHeap.hpp
diffstat 3 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Mon Oct 27 19:15:23 2014 +0000
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu Oct 30 10:51:06 2014 +0100
@@ -1248,7 +1248,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);
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp	Mon Oct 27 19:15:23 2014 +0000
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp	Thu Oct 30 10:51:06 2014 +0100
@@ -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;
 }
--- a/src/share/vm/gc_interface/collectedHeap.hpp	Mon Oct 27 19:15:23 2014 +0000
+++ b/src/share/vm/gc_interface/collectedHeap.hpp	Thu Oct 30 10:51:06 2014 +0100
@@ -644,10 +644,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 ///////////////