1. Include JVM options -XX:+HeapDumpOnOutOfMemoryError
This will create a heap dump whenever a OutOfMemoryException occurs. It will output a .hprof file at your root folder
Then, use jhat
2. Include JVM options -XX:+PrintGCDetails
This command will print current GC details on application output. Good to know what is the current status of the GC.
JConsole is an application that can help you monitor your application real time. You can use JConsole to connect local or remote application for application monitor and analyze.
See the following for more details