Skip to content

Commit fc07978

Browse files
author
Thomas Schatzl
committed
initial alwayspretouch support
1 parent cca7283 commit fc07978

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/hotspot/share/gc/serial/serialCompressor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ class SCCompacter {
297297
size_t size_in_bytes = align_up(num_blocks * sizeof(HeapWord*), os::vm_page_size());
298298
const char* msg = "Not enough memory to allocate block-offset-table for Serial Full GC";
299299
os::commit_memory_or_exit(reinterpret_cast<char*>(addr), size_in_bytes, false /* exec */, msg);
300+
if (AlwaysPreTouch) {
301+
// What to do for the BOT? Make it static?
302+
// os::pretouch_memory(addr, addr + size_in_bytes / HeapWordSize, os::vm_page_size());
303+
}
300304
}
301305
}
302306
}
@@ -485,6 +489,9 @@ SerialCompressor::SerialCompressor(STWGCTimer* gc_timer):
485489
os::commit_memory_or_exit((char *)_mark_bitmap_region.start(), _mark_bitmap_region.byte_size(), false,
486490
"Cannot commit bitmap memory");
487491
_mark_bitmap.initialize(heap->reserved_region(), _mark_bitmap_region);
492+
if (AlwaysPreTouch) {
493+
os::pretouch_memory(heap->reserved_region().start(), heap->reserved_region().end(), bitmap.page_size());
494+
}
488495
}
489496

490497
SerialCompressor::~SerialCompressor() {

0 commit comments

Comments
 (0)