changeset 9615:145927fd1e5c

Fix small miscalculation when freeing humongous regions.
author rkennke
date Fri, 11 Sep 2015 18:36:05 +0200
parents d9175ed51f4c
children 61530c614f13
files src/share/vm/gc/shenandoah/shenandoahHeapRegionSet.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/shenandoah/shenandoahHeapRegionSet.cpp	Fri Sep 11 18:35:26 2015 +0200
+++ b/src/share/vm/gc/shenandoah/shenandoahHeapRegionSet.cpp	Fri Sep 11 18:36:05 2015 +0200
@@ -5,6 +5,7 @@
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
+#include "gc/shenandoah/shenandoahHumongous.hpp"
 #include "memory/resourceArea.hpp"
 #include "utilities/quickSort.hpp"
 
@@ -269,7 +270,7 @@
 
   oop humongous_obj = oop((*r)->bottom() + BrooksPointer::BROOKS_POINTER_OBJ_SIZE);
   size_t size = humongous_obj->size() + BrooksPointer::BROOKS_POINTER_OBJ_SIZE;
-  uint required_regions = (size * HeapWordSize) / ShenandoahHeapRegion::RegionSizeBytes  + 1;
+  uint required_regions = ShenandoahHumongous::required_regions(size * HeapWordSize);
 
   if (ShenandoahTraceHumongous) {
     tty->print_cr("reclaiming "UINT32_FORMAT" humongous regions for object of size: "SIZE_FORMAT" words", required_regions, size);