RFR: 8293989: [JVMCI] re-use cleared oop handles
Doug Simon
dnsimon at openjdk.org
Mon Sep 19 12:15:43 UTC 2022
It's possible for a libgraal isolate to live long enough that `JVMCIRuntime::__oop_handles` grows so much that it overflows when trying to expand. This results in a VM crash something like:
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 18446744056529682432 bytes for AllocateHeap
...
V [libjvm.so+0xe1f441] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x1a1
V [libjvm.so+0xe2006d] VMError::report_and_die(Thread*, char const*, int, unsigned long, VMErrorType, char const*, __va_list_tag*)+0x2d
V [libjvm.so+0x5d8ed3] report_vm_out_of_memory(char const*, int, unsigned long, VMErrorType, char const*, ...)+0xc3
V [libjvm.so+0x39f7c2] AllocateHeap(unsigned long, MEMFLAGS, AllocFailStrategy::AllocFailEnum)+0x92
V [libjvm.so+0x8303f2] GrowableArrayWithAllocator<_jobject*, GrowableArray<_jobject*> >::grow(int)+0x112
V [libjvm.so+0x995385] JVMCIRuntime::make_global(Handle const&)+0x105
The solution implemented in this PR is to clear and re-use entries in `JVMCIRuntime::__oop_handles`.
-------------
Commit messages:
- re-use slots in JVMCIRuntime::_oop_handles
Changes: https://git.openjdk.org/jdk/pull/10337/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10337&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8293989
Stats: 191 lines in 9 files changed: 89 ins; 62 del; 40 mod
Patch: https://git.openjdk.org/jdk/pull/10337.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10337/head:pull/10337
PR: https://git.openjdk.org/jdk/pull/10337
More information about the hotspot-compiler-dev
mailing list