Generational Garbage Collection

Typical performance benefits if the garbage collector, the allocator, and the language share information. The size, contents, and history of an object influence the type of garbage collection that should be used on it. For instance, copying takes time proportional to the size of an object to move the object to the live set. The performance of mark and sweep does not depend on the size of objects.

The classic generational garbage collector is based on the observation that most objects die shortly after they are created. The older an object is, the more likely it is to remain alive. The garbage collector capitalizes on this heuristics by creating new objects in a special area called an eden. Frequent execution of ...

Get Real-Time Java™ Platform Programming 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.