JVM memory model and GC principle

ref:https://blog.csdn.net/ithomer/article/details/6252552

1. Java Memory Model

  Officially, the Java Virtual Machine has a heap, which is the runtime data area from which memory for all class instances and arrays is allocated.

The JVM mainly manages two types of memory: heap and non-heap. Heap memory (Heap Memory) is created when the Java virtual machine starts, and non-heap memory (Non-heap Memory) is memory outside the JVM heap.

In simple terms, the heap is the memory accessible to Java code and reserved for developers; the non-heap is reserved for the JVM for its own use, including the memory required for method areas, JVM internal processing or optimization (such as  JIT  Compiler, Just- in-time Compiler, code cache after just-in-time compilation), per-class structure (such as runtime constant pool, field and method data), and code for methods and constructors.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325950726&siteId=291194637
Recommended