Runtime zones managed by Java (5):
Program counter: (where the current thread bytecode executes, which bytecode to execute, the line number that points to the bytecode)
This can be seen as the line number of the bytecode being executed by the current thread, that is, the exact location of the bytecode used to identify the current thread execution. The bytecode interpreter works by changing the program counter to select the next byte-code instruction to execute.
is thread-private, branch, loop, thread switch, jump, etc. all need to depend on it.
Java Virtual Machine stack: (Information related to method execution, is stack)
Thread-Private;
Each method executes creates a stack frame for storing and executing information about the method, including the local variable table, the operand stack, the method exit, and so on.
Then the execution of each method corresponds to the frame in the stack, the method end corresponds to the frame out of the stack.
Local method Stack:
The stack uses the native method service for the virtual machine (Java calls non-Java code)
Java heap: (Storing objects)
Thread sharing;
The sole purpose of storing object instances;
is the largest chunk of the runtime area managed by the Java Virtual machine.
Method Area:
Areas shared by each thread;
Used to store information such as class information, constants, static variables, etc.;
Run a constant pool: is part of the method area, saving the symbol references described in the class file and the direct references that are translated.
Direct Memory:
Use of the native method to introduce the use of local memory is not limited by the size of the Java heap.
OutOfMemoryError
In addition to the program counters, the other heap or zone throws the exception when it cannot request the required memory.
Java memory area and memory overflow exception