How Java allocates memory to objects?

In Java, all objects have memory located in the heap space where Java's garbage collection constantly remove unused objects to make application memory efficient. The heap space is further divided into sections and it depends on the object's memory where the object will be placed.

This is a companion discussion topic for the original entry at