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

Andrew Dinn adinn at openjdk.org
Wed Oct 11 12:21:09 UTC 2023


On Wed, 11 Oct 2023 11:30:54 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> 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 the sorted list 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, therefore 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.

@tstuefe perhaps CollectMemStat and PrintMemStat would better distinguish the two cases?

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

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


More information about the hotspot-compiler-dev mailing list