Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
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.
|