-
New Feature
-
Resolution: Unresolved
-
Major
-
None
Memory/GC issues are one of the most common causes of Jenkins performance issues in production environments. It is difficult to diagnose these issues without GC logs, and GC logging is not enabled by default in any of the Jenkins packages we distribute. While working with another Java application I support, I noticed that it writes statistics about application memory use to the service log on a regular basis. I realized that if Jenkins did this by default, it could enable debugging of many common memory issues without the need to enable GC logging and restart the JVM. Here's a sample of the log output I'm talking about:
Pool Type Used Committed Init Max Code Cache usage 129.08 MB 133.75 MB 2.44 MB 240.00 MB Code Cache peak 132.27 MB 133.75 MB 2.44 MB 240.00 MB Metaspace usage 195.06 MB 238.02 MB 0 B -1 B Metaspace peak 195.06 MB 238.02 MB 0 B -1 B Compressed Class Space usage 27.42 MB 34.52 MB 0 B 1024.00 MB Compressed Class Space peak 27.42 MB 34.52 MB 0 B 1024.00 MB G1 Eden Space usage 1.091 GB 1.538 GB 83.00 MB -1 B G1 Eden Space collection 0 B 1.538 GB 83.00 MB -1 B G1 Eden Space peak 1.680 GB 1.765 GB 83.00 MB -1 B G1 Survivor Space usage 35.00 MB 35.00 MB 0 B -1 B G1 Survivor Space collection 35.00 MB 35.00 MB 0 B -1 B G1 Survivor Space peak 96.00 MB 96.00 MB 0 B -1 B G1 Old Gen usage 938.52 MB 1.234 GB 1.478 GB 3.117 GB G1 Old Gen collection 0 B 0 B 1.478 GB 3.117 GB G1 Old Gen peak 957.21 MB 2.659 GB 1.478 GB 3.117 GB Collector Count Time G1 Young Generation 1216 46143 G1 Old Generation 0 0