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

NMT: Increase MallocSiteTable size and allocate it only when needed

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b08

      MST size is too small. It was created with a very strict footprint limit, since it needed to be created statically and unconditionally.

      However, JDK-8256844 reworked NMT initialization and now we can move MST initialization to after argument parsing. Since it is only needed with -XX:NativeMemoryTracking=detail, it makes sense to only conditionally allocate it.

      And therefore we can afford to make it larger.

      At the moment, it is 511 entries wide. A typical implementation comes to ~3000-6000 entries. Therefore, typically, the median bucket chain length is 7, which is a lot.

      Increasing table size to ~4000 drops median bucket chain length to 1.

      Example, spring petclinic boot up:

      before:
      ```
      Bucket chain length distribution:
      unused: 1
      longest: 14
      median: 7
      ```

      with table size 4099:
      ```
      Bucket chain length distribution:
      unused: 1751
      longest: 5
      median: 1
      ```



            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: