Configuring Heap Generations
Within the JVM heap are segments called generations. Each generation represents a set of objects that have be kept in memory for about the same amount of time, which makes it easier for the garbage collector to find them. The first generation is called the young generation or sometimes the new generation. This is where memory is initially allocated for most objects. When objects survive GC (that is, they’re still in use) they’re moved to the old generation, which is also called the tenured generation.
The most important of these is the young generation. It determines the size of both generations because it’s reserved first, and the remaining heap space is used for the old generation. The young generation will grow ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access