changeset 55636:313e034d0bcb

8221146: ZGC: Reports too much relocated Reviewed-by: pliden, eosterlund
author stefank
date Mon, 01 Apr 2019 18:34:47 +0200
parents 879051d3772a
children f60c52198a42
files src/hotspot/share/gc/z/zRelocationSetSelector.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();