RFR: 8371014: Dump JFR recording on CrashOnOutOfMemoryError is incorrectly implemented
Markus Grönlund
mgronlun at openjdk.org
Thu Jan 8 12:29:53 UTC 2026
On Wed, 7 Jan 2026 17:45:55 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:
>> TestEmergencyDumpAtOOM.java has passed on both, AIX and linux on PPC64. Thanks!
>
>> TestEmergencyDumpAtOOM.java has passed on both, AIX and linux on PPC64. Thanks!
>
> Thanks Martin.
> Thanks a lot @mgronlun ! Looks good in general.
>
> Can we wait to finish `service.emit_leakprofiler_events()` in JFR recorder thread before the crash at `report_java_out_of_memory()` in debug.cpp? whether `abort()` is called before finishing to dump events by recorder thread.
The solution to is avoid someone calling abort() concurrently until at least one service.emit_leakprofiler_events(); has completed. That's why the invocation is done by all threads coming into report_java_out_of_memory(), not only a cas-selected one. Why?
Because it is only by taking the threads from thread state _thread_in_vm to state _thread_blocked (which we manage as part of posting the JFR msg), that a VM operation in service.emit_leakprofiler_events() can proceed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29094#issuecomment-3723611490
More information about the hotspot-dev
mailing list