Member-only story
The JVM in my eyes, a summary of JVM knowledge points!
tool
Memory partitioning
For most applications, the Java heap is the largest block of memory managed by the Java virtual machine, shared by all threads. The sole purpose of this memory area is to store object instances, and almost all object instances and data are allocated memory here.
For efficient garbage collection, virtual machines allocate heap memory Logic “ Divide the area into three sections( The only reason for partitioning is to optimize GC performance ):
- New Generation (Young Generation): Both new objects and objects who have not reached a certain age are in the new generation
- Old Age (Retirement Area): Objects that have been used for a long time, the memory space of the old age should be larger than that of the younger generation
- Metaspace (formerly known as permanent proxy before JDK1.8): Like temporary objects in some methods, it used JVM memory before JDK1.8 and directly used physical memory after JDK1.8
Young Generation
The younger generation is the place where all new objects are created. When filling the younger generation, perform garbage collection. This type of garbage collection is called Minor GC. The younger generation is divided into three parts — Eden Memory and two Survivor Memories (known as from/to or s0/s1), with a default ratio of 8:1:1
- Most newly created…