AREAS OF MEMORY.
?? ??Saral Saxena ??????
?11K+ Followers | Linkedin Top Voice || Associate Director || 15+ Years in Java, Microservices, Kafka, Spring Boot, Cloud Technologies (AWS, GCP) | Agile , K8s ,DevOps & CI/CD Expert
AREAS OF MEMORY :-
The JVM has different areas of memory that are used to store objects during their natural lifecycle:
■ Eden—Eden is the area of the heap where all objects are initially allocated, and for many objects this will be the only part of memory that they ever reside in.
■ Survivor—There are typically two survivor spaces (or you can think of it as one space split in half). These spaces are where objects that survive from Eden (hence the name) are moved. They are sometimes referred to as From and To. For reasons explained later, one of the survivor spaces is always empty unless a collection is under way.
■ Tenured—The tenured space (a.k.a. old generation) is where surviving objects deemed to be “old enough” are moved to (escaping from the survivor spaces). Tenured memory isn’t collected during young collections.
■ PermGen—This is where memory for internal structures is allocated, such as the definitions of classes. PermGen isn’t strictly part of the heap proper, and ordinaryobjects don’t ever end up here.