Click to enter _ more _java thousand ask
1. What is the structure of the JVM instance?
In the Java Virtual Machine specification, the behavior of a virtual machine instance consists of subsystems, memory regions, data types, and directives.
These components describe an abstract structure inside the JVM. The purpose of these components is not so much to dictate the internal structure of the JVM as to provide a strict definition of the external behavior that defines the interaction of these abstract components and the behavior required for the execution of the Java virtual machine.
Understanding JVM Memory Management Look here: What is the Java memory model
Describes an internal structure of the JVM instance, which mainly includes the main subsystem, memory area.
Let's take a look at the structure of this JVM instance:
The Java Virtual machine has a ClassLoader (class loader subsystem) that acts as a subsystem for the JVM, and the ClassLoader detects the class file to load the corresponding classes interface.
Within the JVM there is an execution engine (Exection engine) that is responsible for the interpretation and execution of the code.
When the JVM runs the program, its memory is used to store a lot of content, including bytecode, additional information extracted from the class file, and objects instantiated in the program, method parameters, return values, local variables, and computed intermediate results.
The memory management of the JVM is divided into two parts: each JVM instance has a method area and a memory heap, both of which store shared data known as threads, and each new thread is assigned its own PC register (PC registers, program counter), local method stack space (native Method stacks), stack space (Java stacks), to store the data inside the thread.
Learn about memory allocation policies See here: What are the policies of memory allocation
See how the JVM manages memory look here: How the JVM manages memory
Java FAQ _07JVM Architecture (002) What is the structure of the _JVM instance