Just doing a server re-start might not be a permanent solution to the out of memory issues. You need to go to the root cause of it.
java.lang.OutOfMemoryError: Java heap space
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.