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

Consolidate Metaspace Statistics

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b23

      Description

      There is a lot of duplicate coding when it comes to the consumption of Metaspace Statistics.

      Metaspace offers statistical APIs via `MetaspaceUtils::(reserved|committed|used)_(words|bytes)` for either the whole metaspace or non-class/class space separately. But many callers need some sort of combination of these values, which they keep in various data holder structures which all are named somewhat similarly and all do a very similar job. In particular, we have:

      - MetaspaceSizesSnapshot (used for gc logs)
      - MetaspaceSnapshot (used in NMT)
      - MetaspaceSizes, MetaspaceSummary, JFRMetaspaceSummary (JFR)
      - MetaspaceCounters, CompressedClassSpaceCounters, MetaspacePerfCounters (jstat performance counters)
      - CompressedKlassSpacePool and MetaspacePool (used for MXBeans)

      As much as possible coding should be unified.

      In addition to that, all these callers share a common problem, in that retrieving individual statistical values via `MetaspaceUtils::(reserved|committed|used)_(words|bytes)` may yield inconsistent values. For example, "reserved" < "committed", or "committed" < "used". This is the cause of a variety of rare intermittent test errors in different areas, e.g. Performance counters (JDK-8163413, JDK-8153323), the gc log, the MemoryPoolMXBean and NMT (JDK-8237872).

      Therefore an API should be added to retrieve statistical values (reserved, committed, used) in one go, and the returned values should be guaranteed to be in sync.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: