JDK-8155098 : Improve CodeCache large page usage and alignment
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2016-04-26
  • Updated: 2016-04-26
  • Resolved: 2016-04-26
Related Reports
Duplicate :  
Description
When reserving memory for the CodeCache, we take the minimum page size that fits both InitialCodeCacheSize and ReservedCodeCacheSize:

const size_t page_size = os::can_execute_large_page_memory() ?
        MIN2(os::page_size_for_region_aligned(InitialCodeCacheSize, 8),
             os::page_size_for_region_aligned(size, 8)) :
        os::vm_page_size();

Since ReservedCodeCacheSize is typically quite small, this might lead to decisions to use smaller pages than optimal and setting ReservedCodeCacheSize to a large value might be necessary for some workloads. Perhaps ReservedCodeCacheSize should be ignored when determining what pages to use.

Additionally, at least for 64-bit systems seems we should consider aligning the VirtualSpace with the large pages memory pages and question padding the "middle" (large page-using) region with a lower and upper region that are filled with default pages. 
Comments
This will be fixed by JDK-8087339. Closing as duplicate.
26-04-2016