From aa84af5298abfc6c290beaef92e6884535119645 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Fri, 18 Apr 2025 17:37:03 -0700 Subject: [PATCH 1/2] 8355069 --- src/hotspot/share/gc/shared/memAllocator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp index 64ca463571890..d6bb3295fcc2e 100644 --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -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, not need to handle, but CheckUnhandledOops 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); From cb2904d762bf009948e59e7b5d152049ea811304 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Fri, 18 Apr 2025 19:20:25 -0700 Subject: [PATCH 2/2] typo fixes --- src/hotspot/share/gc/shared/memAllocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp index d6bb3295fcc2e..fb9304ec2343d 100644 --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -127,7 +127,7 @@ bool MemAllocator::Allocation::check_out_of_memory() { report_java_out_of_memory(message); if (JvmtiExport::should_post_resource_exhausted()) { #ifdef CHECK_UNHANDLED_OOPS - // obj is null, not need to handle, but CheckUnhandledOops not aware about null + // 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(