Overview of the overall structure of JVM

Table of contents

1. Overview of each part

2. JVM life cycle

1. Starting the virtual machine

2. Operation of virtual machine

3. Exit the virtual machine


1. Overview of each part

Note: The method area is only available in the HotSpot virtual machine, not in J9 or JRockit.

2. JVM life cycle

1. Starting the virtual machine

Starting a Java virtual machine is accomplished by 引导类加载器(bootstrap class loader)creating a初始类(initial class)

This class is specified by the specific implementation of the virtual machine.

2. Operation of virtual machine

  1. A running Java virtual machine has a clear task: execute Java programs
  2. It runs when the program starts executing and stops when the program ends.
  3. 执行一个所谓的Java程序的时候,真真正正在执行的是一个叫做Java虚拟机的进程

3. Exit the virtual machine

The following situations will cause the virtual machine to exit:

  1. The program ends normally
  2. The program encountered an exception or error during execution and terminated abnormally.
  3. Java virtual machine process terminated due to operating system error
  4. A thread calls the exit() method of the Runtime class or System class, or the halt() method of the Runtime class, and the Java security manager also allows this exit() or halt() operation.
  5. In addition, the JNI (Java Native Interface) specification describes the exit of the Java virtual machine when the JNI Invocation API is used to load or unload the Java virtual machine.

Guess you like

Origin blog.csdn.net/m0_62609939/article/details/130459977