Talking about JVM Memory Partition of JAVA Virtual Machine

Write a little about the understanding of JVM-related knowledge, without planning a learning route, and writing where you think.

JVM memory is divided into the following areas

1.PC register

It can be understood as a PC in assembly language, which is exclusive to each Java instance/process, and multiple threads of the instance share the PC register.


2. Method area

The method area is sometimes called the permanent area. It is the memory area where Class-related information/objects are stored, including the runtime constant pool.


3.Java virtual machine stack

The memory area where the program runs is exclusively shared by threads, and there is no thread safety issue. For the same stack, a stack frame is generated for each method call.


4. Local method stack

The memory area where Java native methods run.


5.Java heap

The memory area for storing java objects or arrays is divided into the new generation and the old generation. The garbage collection is the most frequent and effective area. It is shared by multiple threads and has thread safety issues.


6. Direct memory

Host memory directly accessible by Java.


The following blog posts will analyze and understand these areas respectively.

Guess you like

Origin blog.csdn.net/zibaihe007/article/details/78684758