When -XX:+UseLargePages, 2M is the typically page size. The mapping of archive heap regions fails because 4k alignment is used for the mmap call. Thanks Stefan Johansson for reporting the mapping failure with -XX:+UseLargePages.
Comments
Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
22-06-2022
Keep in mind that just because UseLargePages is enabled it is not certain that the Java heap is backed by large pages. The dumper need to somehow query the used page size at dump time or get notified during heap initialization about what page size was used.
03-05-2021
void HeapShared::copy_closed_archive_heap_objects(
GrowableArray<MemRegion> * closed_archive) {
...
G1CollectedHeap::heap()->end_archive_alloc_range(closed_archive,
os::vm_allocation_granularity());
}
void HeapShared::copy_open_archive_heap_objects(
GrowableArray<MemRegion> * open_archive) {
...
G1CollectedHeap::heap()->end_archive_alloc_range(open_archive,
os::vm_allocation_granularity());
}
In order to support large page, we need to use os::large_page_size() for alignment if UseLargePages is enabled at dump time.