Programming Languages
Java
Subjective
Sep 24, 2025
Explain Java Memory Model and Garbage Collection.
Detailed Explanation
Java Memory Model consists of Heap (Young Generation: Eden, S0, S1; Old Generation), Method Area/Metaspace, Stack, PC Register, and Native Method Stack. Garbage Collection automatically manages memory by removing unreferenced objects. Common GC algorithms include Serial, Parallel, G1, and ZGC.
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts