8355069: Allocation::check_out_of_memory() should support CheckUnhandledOops mode

Reviewed-by: sspitsyn
This commit is contained in:
Leonid Mesnik 2025-04-29 23:44:45 +00:00
parent 1652948862
commit 83d0bd85af

View File

@ -126,6 +126,10 @@ bool MemAllocator::Allocation::check_out_of_memory() {
// -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
report_java_out_of_memory(message);
if (JvmtiExport::should_post_resource_exhausted()) {
#ifdef CHECK_UNHANDLED_OOPS
// obj is null, no need to handle, but CheckUnhandledOops is not aware about null
THREAD->allow_unhandled_oop(_obj_ptr);
#endif // CHECK_UNHANDLED_OOPS
JvmtiExport::post_resource_exhausted(
JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP,
message);