8330677: Add Per-Compilation memory usage to JFR#18864
8330677: Add Per-Compilation memory usage to JFR#18864tstuefe wants to merge 3 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
|
@tstuefe This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 22 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
/label hotspot-compiler |
|
@tstuefe |
|
/label remove hotspot |
|
@tstuefe |
|
Please also check COPYRIGHT years, e.g. compileTask.cpp . |
Might be helpful to add to the Description part of https://bugs.openjdk.org/browse/JDK-8317683 another sentence that describes how to enable the feature. |
|
Thanks @MBaesken . Please check again to see if I addressed all your issues. |
|
Regarding src/hotspot/share/jfr/metadata/metadata.xml , could you label it 'Arena Peak Usage' or something like this ? I would like to have it more clear that it is the peak usage. |
I already find "Arena Usage" to be too long, to be honest. Longer column labels make the JMC table less readable (ideally, one would have a "label," short and descriptive, and a "description," one being the column label, the other, e.g., a tooltip). And "peak" is really the only option that makes sense here. If you ask someone what they think "usage" means, they will assume its the largest footprint accumulated during compilation over the time span of the compilation, aka peak.
I read through the comments twice and did not find a nullptr related question. Which question?
One synchronization per compilation. So, not that costly, no. It will be enabled by default in debug builds with #18969 since it is implied in memlimit. |
See compilationMemoryStatistic.cpp . At some places we check the result for nullptr e.g. jdk/src/hotspot/share/compiler/compilationMemoryStatistic.cpp Line 79 in b3bcc49 |
Yes, it is inconsistent. Allmost all code here (notably anything triggered from start- or end-compilation) are called from the compiler so we run on a compiler thread and in the scope of a ciEnv. So most of the existing nullptr checks are probably not needed. We may want to make this consistent with subsequent RFEs. |
I agree, this can be a follow up. |
| CompilerThread* const th = Thread::current()->as_Compiler_thread(); | ||
| ArenaStatCounter* const arena_stat = th->arena_stat(); | ||
| const CompilerType ct = th->task()->compiler()->type(); | ||
| CompileTask* const task = th->task(); |
There was a problem hiding this comment.
At some places we check the result for nullptr e.g.
Is that over cautious or should it better be done ?
| const char* _failure_reason; | ||
| // Specifies if _failure_reason is on the C heap. | ||
| bool _failure_reason_on_C_heap; | ||
| size_t _arena_bytes; // peak size of temporary memory during compilation (e.g. node arenas) |
There was a problem hiding this comment.
Is there a good reason not to name it _peak_arena_bytes when it is always the peak as stated ?
| <Field type="boolean" name="isOsr" label="On Stack Replacement" /> | ||
| <Field type="ulong" contentType="bytes" name="codeSize" label="Compiled Code Size" /> | ||
| <Field type="ulong" contentType="bytes" name="inlinedBytes" label="Inlined Code Size" /> | ||
| <Field type="ulong" contentType="bytes" name="arenaBytes" label="Arena Usage" /> |
There was a problem hiding this comment.
Maybe say Peak arena usage, if this is the case as stated above ?
And some info that it is optional / must be enabled to see this data would probably help too.
There was a problem hiding this comment.
Again, there is no space for this. "label" gets used as column header. No space to add a descriptive text.
|
Thanks @MBaesken . For some reason your remarks only got posted now, but I think we covered all points already. /integrate |
|
Going to push as commit 151ef5d.
Your commit was automatically rebased without conflicts. |
We have the (opt-in, disabled by default) compiler memory statistics introduced with JDK-8317683.
Since temporary memory usage by compilers can significantly affect process footprint, it would make sense to expose at least the total peak usage per compilation via JFR.
This patch adds "Arena Usage" to CompilationEvent. We now see in JMC how costly a compilation had been. (The cost can get very high, as we have seen just recently again with JDK-8327247 ).
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18864/head:pull/18864$ git checkout pull/18864Update a local copy of the PR:
$ git checkout pull/18864$ git pull https://git.openjdk.org/jdk.git pull/18864/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18864View PR using the GUI difftool:
$ git pr show -t 18864Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18864.diff
Webrev
Link to Webrev Comment