[10] RFR(S): 8087339: The code heap might use different alignment for committed size and reserved size

Tobias Hartmann tobias.hartmann at oracle.com
Wed Nov 22 13:51:13 UTC 2017


please review the following patch:

The alignment of the code cache is determined in CodeCache::reserve_heap_memory() by computing the minimum of the page
size for the ReservedCodeCacheSize and the InitialCodeCacheSize (which is usually very small and not aligned to the
large page size). As a result, when using large pages (by enabling UseTransparentHugePages or UseHugeTLBFS), the
ReservedSpace is only backed by large pages if the InitialCodeCacheSize is large page aligned as well.

I've changed the implementation to not consider InitialCodeCacheSize and re-factored the code to use
CodeCache::page_size() both for the alignment of heap sizes as well as the alignment of the entire reserved space.

I've verified that this sets the correct alignment on my machine when using 2048K pages instead of 4K pages.


More information about the hotspot-compiler-dev mailing list