Java creates every object in the heap space.
And when the heap space is full, it will throw a
java.lang.OutOfMemoryError: Java heap space.
How does java allocate the memory and create the OutOfMemoryError object when there is no space in the heap?