Output directory based on In-depth Understanding of the JVM
- Summary of the JVM – 01
- JVM-02 class loading subsystem
- Jvm-03 Runtime Data area – [application counter + Vm stack + local method stack + Local method]
- Jvm-04 Runtime Data area – [heap + method area + object instantiation memory layout and access location + direct memory]
- Jvm-05 execution engine + String constant pool StringTable
- Jvm-06 Garbage Collector
preface
Note: Based on a personal output from Understanding the JVM in Depth – 2nd edition – by Chi-ming Chou, this article will be referred to in the page number of the book. B station university related video link address, thank Song Shi. Reference big brother blog link address, thank big brother.
1. The description of the JVM
1.1 some JVM
- SUN Classic
- HotSpot VM: HotSpot code detection technology
- BEA JRockit (BEA acquired by Oracle), one of the fastest JVMS in the world
- TaoBao JVM: TaoBao Tmall is launched to replace Oracle’s official JVM
- .
Book P3-P16: Java History + Various VMS
1.2 Location of the JVM
1.3 Java code execution process
Java programs –(compiled)– > bytecode files –(interpreted execution)– > Operating systems (Win, Linux, Mac).java source files are compiled by a front-end compiler (such as Javac) into.class bytecode files, which are interpreted and executed by a back-end compiler (JVM).
1.4 Architectural model of the JVM
- Due to the cross-platform design, Java instructions are designed on a stack. The stack is zero-address instruction (only out and on the stack), and the execution depends on the operation stack.
- Stack: Small set of instructions, many instructions (frequent in and out operations), easy to implement by the compiler. But the execution performance is worse than the register.
- Register: few instructions
Q: Why not replace the register with higher performance? A: Because of the cross-platform design, Java instructions are designed according to the stack. Different platforms have different CPU architectures, so it cannot be register-based.
1.5 Lifecycle of the JVM
1. Start the
- This is done by bootstrap class Loader to create an initial class, specified by the JVM’s implementation
2. Perform
- Execute Java programs; It runs when the program begins and stops when the program ends. When you execute a Java program, you’re really executing a process called the Java Virtual Machine
3. Quit
- The program completes normally
- The program ends abnormally with an exception or error
- An operating system error caused the termination
- Call the Halt method of the Runtime class or exit method of the System class
1.6 JVM Architecture Overview
Output directory based on In-depth Understanding of the JVM
- Summary of the JVM – 01
- JVM-02 class loading subsystem
- Jvm-03 Runtime Data area – [application counter + Vm stack + local method stack + Local method]
- Jvm-04 Runtime Data area – [heap + method area + object instantiation memory layout and access location + direct memory]
- Jvm-05 execution engine + String constant pool StringTable
- Jvm-06 Garbage Collector