课程: Java Memory Management: Garbage Collection, JVM Tuning, and Spotting Memory Leaks

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Different generations on the heap

Different generations on the heap

- [Instructor] Java actually distinguishes different types of heap memory. And this is relevant for the garbage collection algorithms Java splits up the heap memory and so it can manage it in a more efficient way. We have the young generation and the old generation on heap. And even though it's technically non-heap memory, we also have one other section. And this used to be called the permanent generation, but since Java 8, this actually has been replaced by the metaspace. So first, the young generation. The idea is that most Java objects don't need to live a long life and that they will be part of the young generation only. This is the part of the memory where new objects are created, so it must support very fast allocation of memory. This young memory itself is actually split up into two parts, the eden space and the survivor space. New objects are created in the eden space, and as soon as a certain threshold is reached, the garbage collection starts and moves objects that are still…

内容