RFR: JDK-8317683: Add JIT memory statistics [v2]

Thomas Stuefe stuefe at openjdk.org
Wed Oct 11 11:34:09 UTC 2023


On Tue, 10 Oct 2023 17:28:06 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
>> 
>>  - Feedback Vladimir
>>  - Compilation memory statistic
>
> I think you should allow to collect and print memory stats per method using `CompileCommand=option,<method>,PrintMemStat`
> Also use `DirectivesStack::getMatchingDirective(method, comp);` to find when you need to collect memory statistic.

@vnkozlov Thanks a lot for your feedback!

I liked your idea of reusing CompileCommand. But I wanted to distinguish between "Silently collect statistics, to maybe print with jcmd" and "Collect and print statistics".

So I added two new CompileCommands, "PrintMemStat" and "MemStat". The latter implies the former, but not vice versa. 

If you set "MemStat", you can use "Compiler.memory" jcmd. 
If you set "PrintMemStat", you get a printout when the compilation happens like with the other "PrintXX" commands, but also a printout at the end of VM life. And you can also use "Compiler.memory" jcmd like with "MemStat".

That makes it possible to get by without introducing any new switches. So I removed all switches I initially added.

What do you think, does this make sense? To me it looks like the least complex variant that still preserves silent collection and tracing when one wants tracing.

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

PR Comment: https://git.openjdk.org/jdk/pull/16076#issuecomment-1757478786


More information about the hotspot-compiler-dev mailing list