RFR: 8242440: use separate, destroyable JavaVM instances per libgraal compiler thread
Doug Simon
dnsimon at openjdk.java.net
Mon Apr 18 08:21:16 UTC 2022
On Mon, 18 Apr 2022 06:55:07 GMT, David Holmes <dholmes at openjdk.org> wrote:
> @dougxc I am not clear on what you are doing here, as we don't support loading the JVM more than once per-process and "destroying" a JVM doesn't return a lot of the resources you might expect to be returned.
The JavaVM instances being managed here are separate from the HotSpot JavaVM instance. The former each encapsulate a single SubstrateVM runtime. If you look at `JVMCIRuntime::init_shared_library_javavm`, you'll see that it [calls `JNI_CreateJavaVM` in `libjvmcicompiler.so`](https://github.com/openjdk/jdk/pull/8262/files#diff-f6b79d39a54fc627561d67d22fb07d30eed6dac79520f44016d0019106fde58dR1225). There is one of these (lazily created) SubstrateVM JavaVMs per JVMCIRuntime and they are destroyed when the last thread detaches from a JVMCIRuntime. Destroying these JavaVM instances releases a lot of resources (e.g. a whole SubstrateVM GC heap).
-------------
PR: https://git.openjdk.java.net/jdk/pull/8262
More information about the hotspot-dev
mailing list