Young space

A young space is a partition (or several partitions) of the heap, typically orders of magnitude smaller than the entire heap, where new objects are allocated. The young space is garbage collected separately. This works well when there are plenty of temporary or short-lived objects, which is often the case. This is because the smaller young space can be garbage collected more frequently than the rest of the heap. If objects live longer than a preset amount of time, for example, if they survive one young space collection, they are promoted to another partition of the heap that is less frequently garbage collected.

In this book, the terms "young space" and "nursery" are used interchangeably.

See also Generational garbage collection.

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.