java VM full Name: Java Virtual machine;
Java Virtual machine divides the memory it manages into several different data regions during the execution of a Java program. These areas have their own uses, as well as the creation and destruction times. The memory managed by the Java Virtual Machine includes the following runtime data regions:
1) program counters: A line number indicator that can be thought of as the byte code of the current thread's line. The bytecode interpreter selects the next byte-code instruction that needs to be executed by changing the value of the counter. The multithreading of a Java Virtual machine is implemented in a way that threads rotate and allocate processor execution time. At any given moment, a processor executes only the instructions in one thread. Therefore, each thread requires a separate program counter.
2) Java virtual stack: As with program counters, it is also thread-private. The life cycle is the same as the thread.
3) Local method stack: the native method service that is used for the virtual machine.
4) Java heap: 10 times times the Java heap is a chunk of memory shared by threads, created when the virtual machine is started. This memory area is used to hold object instances. The Java heap is the primary area of garbage collector management.
5) Method area: The same area shared by all threads, used to store data that has been loaded by the virtual machine.
6) Run a constant pool: is part of the method area. Used to hold various literal and symbolic references generated during the compilation period.
7) Direct Memory:
Virtual opportunity to a new directive, first checks whether the parameter of this directive can be positioned in a constant pool for a symbolic reference of a class, and checks whether the class represented by the symbol reference has been loaded, parsed, and initialized. If not, you must first perform the appropriate class loading process. (P45)
Deep understanding of Java Virtual Machine--java memory area and memory overflow exception (i)