jenkinsci / jenkinsci/support-core-plugin
[JENKINS-59956] Support Core should log memory stats regularly
- Dominant language
- Java
- Stars
- 19
- Forks
- 77
- Avg merge
- 17h 53m
- Merged PRs (30d)
- 3
Description
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 InitMax
Code Cache usage 129.08 MB 133.75 MB 2.44 MB 240.00 MB
Code Cache peak132.27 MB 133.75 MB 2.44 MB 240.00 MB
Metaspace usage 195.06 MB 238.02 MB 0 B -1 B
Metaspace peak195.06 MB 238.02 MB 0 B -1 B
Compressed Class Space usage27.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 Spaceusage1.091 GB 1.538 GB 83.00 MB -1 B
G1 Eden Spacecollection 0 B 1.538 GB 83.00 MB -1 B
G1 Eden Spacepeak 1.680 GB 1.765 GB 83.00 MB -1 B
G1 Survivor Space usage35.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 peak957.21 MB 2.659 GB 1.478 GB 3.117 GB
Collector Count Time
G1 Young Generation 1216 46143
G1 Old Generation 0 0
```
---
Originally reported by
owenmehegan, imported from: Support Core should log memory stats regularly
allan_burdajewicz
Raw content of original issue
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 GBCollector Count Time
G1 Young Generation 1216 46143
G1 Old Generation 0 0
Contributor guide
Research direction
Start in the support-core-plugin repository by locating the existing periodic service-log or monitoring entry point; the issue does not name a file or test. Compare the output with the supplied memory-pool and collector sample, and consider the work complete when memory statistics are logged regularly in the requested format without requiring GC logging or a JVM restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100