RFR: 8364090: Dump JFR recording on CrashOnOutOfMemoryError [v4]
Thomas Stuefe
stuefe at openjdk.org
Tue Jul 29 06:23:57 UTC 2025
On Mon, 28 Jul 2025 12:02:47 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> JFR emergency dump would happen when OOM was thrown. However it would not contain most recent `OldObjectSample` events emitted by LeakProfiler.
>>
>> I [reported this issue in past](https://mail.openjdk.org/pipermail/hotspot-jfr-dev/2019-January/000381.html), and it seems to be difficult to fix soon, and also JDK codebase has been updated in several years. It brings us to fix this issue easier than past.
>>
>> So I propose again to emit the events from LeakProfiler when OOM happened.
>> This change passed `jdk_jfr` tests on Linux x64 (excepts TestHeapSummaryEventPSParOld.java reported in [JDK-8364082](https://bugs.openjdk.org/browse/JDK-8364082))
>>
>> Related email thread: https://mail.openjdk.org/pipermail/hotspot-jfr-dev/2025-July/008007.html
>
> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
>
> Add testcase
Looks good to me, provided Erik is happy.
test/jdk/jdk/jfr/event/oldobject/TestEmergencyDumpAtOOM.java line 70:
> 68: var p = ProcessTools.createTestJavaProcessBuilder(args).start();
> 69: p.waitFor();
> 70: var output = new OutputAnalyzer(p);
I'm not a big fan of var, since it degrades the readability. I like to know which types I deal with when reading code.
Not sure what others think, though, or if there is a Java style guideline similar to our hotspot style guide.
-------------
Marked as reviewed by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26468#pullrequestreview-3065672936
PR Review Comment: https://git.openjdk.org/jdk/pull/26468#discussion_r2238651593
More information about the hotspot-jfr-dev
mailing list