RFR: JDK-8260571: Add PrintMetaspaceStatistics to print metaspace statistics upon VM exit

Thomas Stuefe stuefe at openjdk.java.net
Sun Jan 31 08:59:42 UTC 2021


On Fri, 29 Jan 2021 23:20:17 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> I am wondering if we should use UL to avoid adding new command-line options. How about this in `print_statistics()` in java.c? This way you can also distinguish the output with other "legacy" logs such as `PrintSystemDictionaryAtExit` (because `MetaspaceUtils::print_basic_report` doesn't indicate where its output starts and ends).
> 
> ```
> LogStreamHandle(Info, metaspace) metaspace_log;
> if (metaspace_log.is_enabled()) {
>   MetaspaceUtils::print_basic_report(&metaspace_log, 0);
> }
> ```
> 
> Eventually we should move `PrintSystemDictionaryAtExit`, etc, to UL as well. We may need to add a new `atexit` tag for flexibility, so you can say
> 
> ```
> java -Xlog:systemdictionary+atexit -Xlog:metaspace+atexit:file=metsapce.log
> ```

I rather would leave the translation of the "XXAtExit" flags to UL - if it even happens in that way - for anther patch instead of mixing those two unrelated issues together. Easier to backport, for one thing.

Note that I am also not convinced that is the right way to do. I'm not completely against it but tbh I find the way UL handles tags very strange, with the tags being a jumble of component names, phase descriptors and what feels like just random words. It is certainly a uncommon system and has a number of drawbacks. So I wonder whether it would make sense to have a discussion before further going down this road.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2283


More information about the hotspot-runtime-dev mailing list