Package org.graalvm.nativeimage
Class VMRuntime
java.lang.Object
org.graalvm.nativeimage.VMRuntime
Used for doing VM runtime operations.
- Since:
- 19.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Dumps the heap to theoutputFile
file in the same format as the hprof heap dump.static void
Initializes the VM: Runs all startup hooks that were registered during image building.static void
shutdown()
Shuts down the VM: Runs all shutdown hooks and waits for all finalization to complete.
-
Method Details
-
initialize
public static void initialize()Initializes the VM: Runs all startup hooks that were registered during image building. Startup hooks usually depend on option values, so it is recommended (but not required) that all option values are set before calling this method.Invoking this method more than once has no effect, i.e., startup hooks are only executed at the first invocation.
- Since:
- 19.0
-
shutdown
public static void shutdown()Shuts down the VM: Runs all shutdown hooks and waits for all finalization to complete.This method should only be called once. Invoking this method multiple times can have continued effects. Also, although recommended, it is not strictly required for
initialize()
to be called before this method.- Since:
- 19.0
-
dumpHeap
Dumps the heap to theoutputFile
file in the same format as the hprof heap dump.- Throws:
UnsupportedOperationException
- if this operation is not supported.IOException
- Since:
- 20.1
-