I read from some documents that Hotspot VM utilizes a data structure called Oop Maps to manage all OOPs in VM. My question is that when does this Oop Map data structure generated? At compile time or runtime? Any further detailed documents regarding to this will be more than welcomed. Thank you guys.
The JDK provides one or more implementations of the Java virtual machine (VM): On platforms typically used for client applications, the JDK comes with a VM implementation called the Java HotSpot Client VM (client VM). The client VM is tuned for reducing start-up time and memory footprint.
HotSpot is a dynamic compiler. It combines the best features of a JIT compiler and an interpreter, combining the two in a single package. That two-in-one combination provides a number of important benefits for code performance, as you will shortly see.
GraalVM is based on Java HotSpot VM, but integrates an advanced just-in-time (JIT) compiler, written in Java - the Graal compiler. At runtime, the application is loaded and executed normally on the JVM. The JVM passes bytecode to the Graal compiler, which compiles that to the machine code and returns it to the JVM.
In order try the HotSpot JVM, I downloaded and installed JDK 17 (Java SE 17) on my Windows computer: Open the Java SE Download page with this URL: https://www.oracle.com/java/technologies/downloads/. Click the "Windows" tab under the "Java SE Development Kit 17.0. 1 downloads".
OopMap is a structure that records where object references (OOPs) are located on the Java stack. Its primary purpose is to find GC roots on Java stacks and to update the references whenever objects are moved within the Heap.
There are three kinds of OopMaps:
During GC JVM walks through all thread stacks. Each stack is parsed as a stream of stack frames. The frames are either interpreted or compiled or stubs. Interpreted frames contain information about Java method and bci (bytecode index). OopMapCache helps to find an OopMap corresponding to the given method and bci. The method of a compiled frame is discovered by instruction address lookup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With