Interview Prep/Jenkins/Backups, HA, upgrades & performance

How do you size and tune the controller JVM?

AdvancedConceptBackups, HA, upgrades & performance
Answer

Set heap explicitly (-Xms = -Xmx, or -XX:MaxRAMPercentage=75 in containers), use G1GC (default on JDK 17+), enable GC logging and heap dumps on OOM:

JAVA_OPTS="-XX:MaxRAMPercentage=75 -XX:+UseG1GC -XX:+UseStringDeduplication \
  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/jenkins_home/heapdumps \
  -Xlog:gc*:file=/var/jenkins_home/logs/gc.log:time,uptime:filecount=5,filesize=20m"

Typical controllers need 4–16 GB heap depending on job count, build retention and concurrent pipelines. Growing beyond that usually signals too much on one controller.

All Jenkins questions Roadmap: Jenkins

More on Backups, HA, upgrades & performance