Java Virtual Runtime data area:
Relevant area Description:
Program Counter:
Function: The line number indicator of the byte code executed by the current thread. If the Java method records the instruction address, if the native method is not logged
Isolation: Thread Isolation
Error: None
Java Virtual machine stack :
Features: Describes the memory model that Java methods perform: Each method executes a stack frame that stores information such as local variable tables, operand stacks, dynamic links, method exits, and so on.
Isolation: Thread Isolation
Error: Stackoverflowerror exception is thrown when the stack depth of a thread request is greater than the depth allowed by the virtual machine;
The dynamic extension fails to request enough memory to throw a OutOfMemoryError exception.
Local Variables table: The memory space required for a local variable table is allocated during compilation, containing various basic data types, and object references.
Local method Stack:
Function: The native method service that is used by the virtual machine. (Virtual machine stack is a Java method (i.e. bytecode) service)
Isolation: Thread Isolation
Error:stackoverflowerror and OutOfMemoryError
Java heap:
Functions: Storing object instances
Isolation: Thread sharing
Error:outofmemoryerror
Subdivision: The angle of memory recycling: New generation, Laosheng generation
Memory allocation angle: The Java heap may divide multiple thread-private allocation buffers.
Virtual machine limit: No contiguous memory space required, can be fixed size or extensible
Method Area:
Features: Store class information, constants, static variables, even compiler-compiled code, that have been loaded by the virtual machine.
Isolation: Thread sharing
Error:outofmemoryerror
Virtual Machine Limitations: No contiguous memory space is required, can be fixed size or extensible, and this area of memory recycling is primarily for the collection of constant pools and unloading of types.
Run a constant pool: part of a method area
Functions: Used to store various literal and symbolic references generated during the compilation period, and direct references translated
Features: Dynamic, you can also put new constants into the pool during run time.
Error:outofmemoryerror
Introduction to the location and function of each memory area of the Java Virtual machine