They separate memory into Young and Old generations.
Generational collectors optimize GC by focusing on the Young generation where most objects die quickly. This reduces pause times. In a shopping platform, frequent customer session objects are quickly collected from the Young generation, minimizing impact on performance.
Additional Notes
How do generational garbage collectors manage memory?