Java heap
As soon you start your application, JVM asks for some memory from the operating system. It then provides this space for your application. Part of this space is called as Java heap memory, which is located at the bottom of the address space. This place is used for storing all the objects created by using the operator new.
As long as you have an active reference to this newly created object, it uses memory space in heap. Once you remove this reference, this object becomes an orphan and available for removal so that JVM can claim this allocated memory and provide it to other objects. In order to clean this dead reference, Java has provided a tool called garbage collector. This garbage collector then collects all the orphan objects ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access