It separates objects by age to optimize collection frequency.
Generational Garbage Collection divides the heap into 'young' and 'old' generations. New objects are allocated in the 'young' generation, where garbage collection occurs more frequently. Objects that survive multiple collections are promoted to the 'old' generation, which is collected less frequently. This approach takes advantage of the fact that most objects die young, improving efficiency. For example, in an e-commerce application, temporary cart objects might be collected quickly, while user profiles persist longer.
Additional Notes
How does Generational Garbage Collection optimize memory management?