RFR: 8280088: NMT: Make mtGCCardSet the subcategory of mtGC
Thomas Stuefe
stuefe at openjdk.java.net
Tue Jan 18 05:47:24 UTC 2022
On Mon, 17 Jan 2022 18:11:17 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> [JDK-8017163](https://bugs.openjdk.java.net/browse/JDK-8017163) introduced a new category, `mtGCCardSet` in NMT tracking. This makes logging look rather weird, and technically miscounts the space taken by GC-specific data structures, if you are accustomed to look at "GC" only:
>
>
> - GC (reserved=142426KB, committed=142426KB)
> (malloc=89554KB #3658)
> (mmap: reserved=52872KB, committed=52872KB)
>
> - GCCardSet (reserved=128KB, committed=128KB)
> (malloc=128KB #1539)
>
>
> We can instead recast it as the subcategory of `mtGC`. It would be similar to `mtThreadStacks` that are accounted separately, but reported as part of `mtThread`.
>
>
> - GC (reserved=142584KB, committed=142584KB)
> (card sets: 128KB)
> (malloc=89583KB #3780)
> (mmap: reserved=52872KB, committed=52872KB)
>
>
> Additional testing:
> - [x] Linux x86_64 fastdebug `runtime/NMT`
> - [ ] Linux x86_64 fastdebug `tier1`
Hi Aleksey,
I'm not too thrilled by this since it breaks up the strict accounting of allocated memory by allocation API (malloc or mmap). Semantic subcategory is orthogonal to that, and now it gets confusing since card sets are malloced too. So the malloced memory reported under mtGC now excludes malloced memory for card sets? That we do a similar thing for thread stacks does not count; those are different anyway and handling them separately feels okay.
A clean way to do this would be to introduce a generic concept of a category tree. Then reporting it as a tree, not a flat list, with higher up nodes reporting both total and node-only sums for both malloc and mmap.
A watered-down, pragmatic version could be to introduce "compound categories" which do no accounting themselves but are reported as a sum of other categories. Then you have a two-level hierarchy and could have things like mtGCCardSet, mtGCWhatever, and mtGC being the sum of all these other mtGC* categories.
Both approaches would be less hacky, the latter is not really invasive but just a reporting issue.
Just my 5c,
..Thomas
-------------
PR: https://git.openjdk.java.net/jdk/pull/7115
More information about the hotspot-gc-dev
mailing list