Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8155098

Improve CodeCache large page usage and alignment

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 9
    • hotspot
    • None
    • generic
    • generic

      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.

            thartmann Tobias Hartmann
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: