I use to get most of the time out of memory issue. So I fixed this issue by restarting the server which is not best practice. I did the permanent fix by increase the Perm Gen Space and Heap Space.