RFR: 8356848: Separate Metaspace and GC printing [v4]

Joel Sikström jsikstro at openjdk.org
Thu May 22 08:51:52 UTC 2025


On Thu, 22 May 2025 08:19:00 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update new order in tests
>
> src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp line 62:
> 
>> 60: void MetaspaceDCmd::execute(DCmdSource source, TRAPS) {
>> 61:   MetaspaceUtils::print_on(output());
>> 62: 
> 
> Okay, though arguably somewhat redundant with the following output

Sure. Should I revert adding this line, leaving the Metaspace jcmd unchanged?

> test/hotspot/jtreg/serviceability/dcmd/gc/HeapInfoTest.java line 48:
> 
>> 46:         OutputAnalyzer output = executor.execute(cmd);
>> 47:         output.shouldNotContain("Unknown diagnostic command");
>> 48:         output.shouldHaveExitValue(0);
> 
> This was already kind of weak before and is almost useless now :) can we improve on that? A command reporting back nothing would now result in a green test?

I agree. It's hard to grep for specific information since most GC have different approaches to printing similar information.

However, all GCs (even Epsilon) print the string "used", so maybe grepping for that is a reasonable approach, just to see that something is printed?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25214#discussion_r2101998172
PR Review Comment: https://git.openjdk.org/jdk/pull/25214#discussion_r2102001583


More information about the hotspot-dev mailing list