JVM manajeri memory kanthi otomatis — nalokasiken objek lan mbebaskaken sing ora bisa diraih liwat garbage collection (GC) — supaya sampeyan ora perlu mbebaskaken memory kanthi manual. Ngerti babagan region memory lan kelakuwan GC penting banget kanggo ngrewangi performa lan diagnosa masalah memory.
Region memory JVM
HEAP — where all OBJECTS live (shared across threads), GC operates here
├── Young Generation — new objects (most die young)
│ ├── Eden — new allocations go here
│ └── Survivor — objects that survived a young GC
└── Old (Tenured) Gen — long-lived objects (promoted from young)
STACK — per-thread; method frames, local variables, primitive locals, references
Metaspace — class metadata (replaced PermGen in Java 8+)
