Java Virtual machine memory structure
Introduction Program counters for each region
A program counter that records the address of an instruction that each thread is executing. Each thread has a thread counter, so the zone is "thread-private" memory, with the same life cycle as the thread. If the thread is executing a native local method, the program counter is empty.
Virtual Machine Stack Area
Each time a thread executes a method, the virtual machine creates a stack frame in the region that stores information such as local variables, dynamic links, method exits, and so on. This zone is also a "thread-private" memory.
Local method Stack
The local method stack is primarily used to execute the native method service
Java heap
All threads share a zone that is created when the virtual machine is started. The only purpose of the zone is to save the object instance, and the virtual machine memory management is primarily a garbage collection (GC) of this area. For GC, the virtual machine divides the region into several sub-regions: The New Generation (Eden, from Survivor, to survivor), and the Laosheng generation.
Method area
Used to hold virtual machine load class information, constants, static variables, code data, and so on, this area is the usual meaning of the permanent generation. The run-time constant pool belongs to this method area, which holds various literal constants and symbolic references.
Introduction to Jvm--java virtual machine memory structure