Back In the print window choose "Save as PDF" as the destination
NOTE.CS

Java Memory and Garbage Collection

1 topic ยท 28 Nov 2026
1

Java Memory and Garbage Collection

Java
  • Stack โ€” method calls and local variables, one per thread.
  • Heap โ€” all objects; shared by threads; divided into Young generation (Eden, Survivor) and Old generation.
  • Method area / Metaspace โ€” class metadata and static variables.
  • An object becomes eligible for GC when no reference points to it. System.gc() is only a request.