OutOfMemoryError: Java heap space Error

I am getting below error in Java Application:

java.lang.OutOfMemoryError: Java heap space

What does this error means and how we can resolve this?


Memory leaks is very genuine problem in java. When it occurs then your application start taking so much heap memory
A Memory Leak is a situation when there are objects present in the heap that are no longer used, but the garbage collector is unable to remove them from memory

Following are the symptoms for memory leaks

  • performance degradation
  • java.lang.OutOfMemoryError: Java heap space
  • The application is occasionally running out of connection objects