-
Enhancement
-
Resolution: Fixed
-
P4
-
16
-
b23
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.
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 (
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.
- duplicates
-
JDK-8266183 Provide an API to get statistics from metaspace in a consistent manner
- Closed
-
JDK-8266183 Provide an API to get statistics from metaspace in a consistent manner
- Closed
- relates to
-
JDK-8151460 Metaspace counters can have inconsistent values
- Resolved
-
JDK-8237872 runtime/NMT/ThreadedVirtualAllocTestType.java test failure in JDK 15
- Closed
-
JDK-8266183 Provide an API to get statistics from metaspace in a consistent manner
- Closed
-
JDK-8251158 Implementation of JEP 387: Elastic Metaspace
- Resolved
(1 relates to, 2 links to)