This error indicates that there is no enough heap space available for the creation of the Java Objects.
There could be many reasons causing this situation.
1. If the application is generating more objects (consuming more heap space) than the one allocated one.
2. If the application is not releasing the resources associated with the objects even after a Garbage Collection. This situation is called Memory leak.
For different types of Out Of Memory issues refer the below link.