< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp

Print this page
rev 54037 : 8220350: Refactor ShenandoahHeap::initialize
Reviewed-by: XXX
rev 54039 : 8220162: Shenandoah should not commit HugeTLBFS memory
Reviewed-by: XXX


 642   // below the garbage threshold that would never be considered for collection.
 643   //
 644   // The whole thing is mitigated if Elastic TLABs are enabled.
 645   //
 646   guarantee(MaxTLABSizeBytes == 0, "we should only set it once");
 647   MaxTLABSizeBytes = MIN2(ShenandoahElasticTLAB ? RegionSizeBytes : (RegionSizeBytes / 8), HumongousThresholdBytes);
 648   assert (MaxTLABSizeBytes > MinTLABSize, "should be larger");
 649 
 650   guarantee(MaxTLABSizeWords == 0, "we should only set it once");
 651   MaxTLABSizeWords = MaxTLABSizeBytes / HeapWordSize;
 652 
 653   log_info(gc, init)("Regions: " SIZE_FORMAT " x " SIZE_FORMAT "%s",
 654                      RegionCount, byte_size_in_proper_unit(RegionSizeBytes), proper_unit_for_byte_size(RegionSizeBytes));
 655   log_info(gc, init)("Humongous object threshold: " SIZE_FORMAT "%s",
 656                      byte_size_in_proper_unit(HumongousThresholdBytes), proper_unit_for_byte_size(HumongousThresholdBytes));
 657   log_info(gc, init)("Max TLAB size: " SIZE_FORMAT "%s",
 658                      byte_size_in_proper_unit(MaxTLABSizeBytes), proper_unit_for_byte_size(MaxTLABSizeBytes));
 659 }
 660 
 661 void ShenandoahHeapRegion::do_commit() {
 662   if (!os::commit_memory((char *) _reserved.start(), _reserved.byte_size(), false)) {
 663     report_java_out_of_memory("Unable to commit region");
 664   }
 665   if (!_heap->commit_bitmap_slice(this)) {
 666     report_java_out_of_memory("Unable to commit bitmaps for region");
 667   }
 668   _heap->increase_committed(ShenandoahHeapRegion::region_size_bytes());
 669 }
 670 
 671 void ShenandoahHeapRegion::do_uncommit() {
 672   if (!os::uncommit_memory((char *) _reserved.start(), _reserved.byte_size())) {
 673     report_java_out_of_memory("Unable to uncommit region");
 674   }
 675   if (!_heap->uncommit_bitmap_slice(this)) {
 676     report_java_out_of_memory("Unable to uncommit bitmaps for region");
 677   }
 678   _heap->decrease_committed(ShenandoahHeapRegion::region_size_bytes());
 679 }


 642   // below the garbage threshold that would never be considered for collection.
 643   //
 644   // The whole thing is mitigated if Elastic TLABs are enabled.
 645   //
 646   guarantee(MaxTLABSizeBytes == 0, "we should only set it once");
 647   MaxTLABSizeBytes = MIN2(ShenandoahElasticTLAB ? RegionSizeBytes : (RegionSizeBytes / 8), HumongousThresholdBytes);
 648   assert (MaxTLABSizeBytes > MinTLABSize, "should be larger");
 649 
 650   guarantee(MaxTLABSizeWords == 0, "we should only set it once");
 651   MaxTLABSizeWords = MaxTLABSizeBytes / HeapWordSize;
 652 
 653   log_info(gc, init)("Regions: " SIZE_FORMAT " x " SIZE_FORMAT "%s",
 654                      RegionCount, byte_size_in_proper_unit(RegionSizeBytes), proper_unit_for_byte_size(RegionSizeBytes));
 655   log_info(gc, init)("Humongous object threshold: " SIZE_FORMAT "%s",
 656                      byte_size_in_proper_unit(HumongousThresholdBytes), proper_unit_for_byte_size(HumongousThresholdBytes));
 657   log_info(gc, init)("Max TLAB size: " SIZE_FORMAT "%s",
 658                      byte_size_in_proper_unit(MaxTLABSizeBytes), proper_unit_for_byte_size(MaxTLABSizeBytes));
 659 }
 660 
 661 void ShenandoahHeapRegion::do_commit() {
 662   if (!_heap->is_heap_region_special() && !os::commit_memory((char *) _reserved.start(), _reserved.byte_size(), false)) {
 663     report_java_out_of_memory("Unable to commit region");
 664   }
 665   if (!_heap->commit_bitmap_slice(this)) {
 666     report_java_out_of_memory("Unable to commit bitmaps for region");
 667   }
 668   _heap->increase_committed(ShenandoahHeapRegion::region_size_bytes());
 669 }
 670 
 671 void ShenandoahHeapRegion::do_uncommit() {
 672   if (!_heap->is_heap_region_special() && !os::uncommit_memory((char *) _reserved.start(), _reserved.byte_size())) {
 673     report_java_out_of_memory("Unable to uncommit region");
 674   }
 675   if (!_heap->uncommit_bitmap_slice(this)) {
 676     report_java_out_of_memory("Unable to uncommit bitmaps for region");
 677   }
 678   _heap->decrease_committed(ShenandoahHeapRegion::region_size_bytes());
 679 }
< prev index next >