Monitor Memory usage and Garbage Collection in Bamboo
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
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -verbose:gc -Xloggc:/path/to/gc.log
- Remember to substitute
/path/to/gc.logwith a meaningful file path on your server
-XX:NumberOfGCLogFiles=5is a suggested number of files to be kept, you can adjust it to your needs. You can also fully disable automatic log rotation by removing the
- Some Garbage Collector parameters were deprecated in JDK 11. Please refer to the following KB article for details:
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.