A simple way to do this is to turn on garbage collection and heap dump on out of memory.
Please add the following parameters to Bamboo
Note: Remember to substitute
/path/to/gc.log with a meaningful file path on your server.
GC log file location
The garbage collection traces and the heap dumps are in
-XX:+PrintGCTimeStamps flag, prints when GCs happen relative to the start of the application.