JVM స్వయంచాలకంగా మెమరీని నిర్వహిస్తుంది — objects ను కేటాయించడం మరియు garbage collection (GC) ద్వారా చేరుకోలేని వస్తువులను విడుదల చేయడం — కాబట్టి మీరు మెమరీని manually విడుదల చేయవలసిన అవసరం లేదు. మెమరీ ప్రాంతాలు మరియు GC ప్రవర్తనను అర్థం చేసుకోవడం పనితీరుని సర్దుబాటు చేయడానికి మరియు మెమరీ సమస్యలను నిర్ధారించడానికి కీలకమైనది.
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+)
