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

Adjustment to anonymous metadata space chunk allocation algorithm

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b36

      Description

      Anonymous metaspace has about 60% memory waste (See JDK-8187338 for details.)

      It turns out that current chunk allocation sizing algorithm is not optimized for anonymous metaspace, especially, its metadata space.

      The average occupancy size of metadata space is just a little over 1K. Current algorithm initializes metadata space with SpecializeChunk (1K), then immediately bumps up to SmallChunk (4K) once the initial chunk exhausted.

      Based on usage distribution, there is about 50% metadata spaces only use 1K - 2K memory, out of 5K of allocated space, which is the major contribution to about 60% total waste of anonymous metaspace.

      The enhancement purposes, for anonymous metadata space, to stay with SpecializedChunk, instead of jumping to SmallChunk, up to 4 limit.

      My experiment shows that it reduces total anonymous metaspace waste from ~60% to ~30%.







        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zgu Zhengyu Gu
                Reporter:
                zgu Zhengyu Gu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: