changeset 57728:f30115dede77

8237201: ZGC: Remove unused ZRelocationSetSelector::fragmentation() Reviewed-by: tschatzl
author pliden
date Fri, 17 Jan 2020 10:20:38 +0100
parents d06f42327c32
children 2189f1e9bab1
files src/hotspot/share/gc/z/zRelocationSetSelector.cpp src/hotspot/share/gc/z/zRelocationSetSelector.hpp
diffstat 2 files changed, 4 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/z/zRelocationSetSelector.cpp	Fri Jan 17 10:20:38 2020 +0100
+++ b/src/hotspot/share/gc/z/zRelocationSetSelector.cpp	Fri Jan 17 10:20:38 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,7 @@
     _registered_pages(),
     _sorted_pages(NULL),
     _nselected(0),
-    _relocating(0),
-    _fragmentation(0) {}
+    _relocating(0) {}
 
 ZRelocationSetSelectorGroup::~ZRelocationSetSelectorGroup() {
   FREE_C_HEAP_ARRAY(ZPage*, _sorted_pages);
@@ -50,8 +49,6 @@
 void ZRelocationSetSelectorGroup::register_live_page(ZPage* page, size_t garbage) {
   if (garbage > _fragmentation_limit) {
     _registered_pages.add(page);
-  } else {
-    _fragmentation += garbage;
   }
 }
 
@@ -143,13 +140,7 @@
 
   // Finalize selection
   _nselected = selected_from;
-
-  // Update statistics
   _relocating = selected_from_size;
-  for (size_t i = _nselected; i < npages; i++) {
-    ZPage* const page = _sorted_pages[i];
-    _fragmentation += page->size() - page->live_bytes();
-  }
 
   log_debug(gc, reloc)("Relocation Set (%s Pages): " SIZE_FORMAT "->" SIZE_FORMAT ", " SIZE_FORMAT " skipped",
                        _name, selected_from, selected_to, npages - _nselected);
@@ -167,16 +158,11 @@
   return _relocating;
 }
 
-size_t ZRelocationSetSelectorGroup::fragmentation() const {
-  return _fragmentation;
-}
-
 ZRelocationSetSelector::ZRelocationSetSelector() :
     _small("Small", ZPageSizeSmall, ZObjectSizeLimitSmall),
     _medium("Medium", ZPageSizeMedium, ZObjectSizeLimitMedium),
     _live(0),
-    _garbage(0),
-    _fragmentation(0) {}
+    _garbage(0) {}
 
 void ZRelocationSetSelector::register_live_page(ZPage* page) {
   const uint8_t type = page->type();
@@ -187,8 +173,6 @@
     _small.register_live_page(page, garbage);
   } else if (type == ZPageTypeMedium) {
     _medium.register_live_page(page, garbage);
-  } else {
-    _fragmentation += garbage;
   }
 
   _live += live;
@@ -226,7 +210,3 @@
 size_t ZRelocationSetSelector::relocating() const {
   return _small.relocating() + _medium.relocating();
 }
-
-size_t ZRelocationSetSelector::fragmentation() const {
-  return _fragmentation + _small.fragmentation() + _medium.fragmentation();
-}
--- a/src/hotspot/share/gc/z/zRelocationSetSelector.hpp	Fri Jan 17 10:20:38 2020 +0100
+++ b/src/hotspot/share/gc/z/zRelocationSetSelector.hpp	Fri Jan 17 10:20:38 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,6 @@
   ZPage**           _sorted_pages;
   size_t            _nselected;
   size_t            _relocating;
-  size_t            _fragmentation;
 
   void semi_sort();
 
@@ -57,7 +56,6 @@
   ZPage* const* selected() const;
   size_t nselected() const;
   size_t relocating() const;
-  size_t fragmentation() const;
 };
 
 class ZRelocationSetSelector : public StackObj {
@@ -66,7 +64,6 @@
   ZRelocationSetSelectorGroup _medium;
   size_t                      _live;
   size_t                      _garbage;
-  size_t                      _fragmentation;
 
 public:
   ZRelocationSetSelector();
@@ -78,7 +75,6 @@
   size_t live() const;
   size_t garbage() const;
   size_t relocating() const;
-  size_t fragmentation() const;
 };
 
 #endif // SHARE_GC_Z_ZRELOCATIONSETSELECTOR_HPP