8221146: ZGC: Reports too much relocated
authorstefank
Mon, 01 Apr 2019 18:34:47 +0200
changeset 54362 313e034d0bcb
parent 54361 879051d3772a
child 54363 f60c52198a42
8221146: ZGC: Reports too much relocated Reviewed-by: pliden, eosterlund
src/hotspot/share/gc/z/zRelocationSetSelector.cpp
--- a/src/hotspot/share/gc/z/zRelocationSetSelector.cpp	Mon Apr 01 18:34:39 2019 +0200
+++ b/src/hotspot/share/gc/z/zRelocationSetSelector.cpp	Mon Apr 01 18:34:47 2019 +0200
@@ -103,6 +103,7 @@
   const size_t npages = _registered_pages.size();
   size_t selected_from = 0;
   size_t selected_to = 0;
+  size_t selected_from_size = 0;
   size_t from_size = 0;
 
   semi_sort();
@@ -127,6 +128,7 @@
     if (diff_reclaimable > ZFragmentationLimit) {
       selected_from = from;
       selected_to = to;
+      selected_from_size = from_size;
     }
 
     log_trace(gc, reloc)("Candidate Relocation Set (%s Pages): "
@@ -138,7 +140,7 @@
   _nselected = selected_from;
 
   // Update statistics
-  _relocating = from_size;
+  _relocating = selected_from_size;
   for (size_t i = _nselected; i < npages; i++) {
     ZPage* const page = _sorted_pages[i];
     _fragmentation += page->size() - page->live_bytes();