One of the major benefits of the Java language in comparison with other object oriented languages (like C++) is that programmers do not have to handle memory allocation during execution of the program. It is totally delegated to the garbage collector (GC) which is in charge of removing unused objects to release memory.
JVM memory organisation
- the heap memory
- the non heap memory
The heap memory
The heap is devided into two generations: The Young Generation and the Tenured Generation.