Explain garbage collection algorithms in Java.

Mid Java

Answer

Mark-and-Sweep marks live objects and removes unused ones.
Generational GC optimizes by separating objects into young and old generations.
Stop-the-world pauses occur during GC phases.
Modern collectors like G1 and ZGC reduce latency.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice