|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * images/using_images/images-other-jenkins-agent.adoc |
| 4 | + |
| 5 | +[id="images-other-jenkins-agent-env-var_{context}"] |
| 6 | += Jenkins agent environment variables |
| 7 | + |
| 8 | +Each Jenkins agent container can be configured with the following environment |
| 9 | +variables. |
| 10 | + |
| 11 | +[options="header"] |
| 12 | +|=== |
| 13 | +| Variable | Definition | Example values and settings |
| 14 | + |
| 15 | +|`JAVA_MAX_HEAP_PARAM`, |
| 16 | +`CONTAINER_HEAP_PERCENT`, |
| 17 | +`JENKINS_MAX_HEAP_UPPER_BOUND_MB` |
| 18 | +|These values control the maximum heap size of the Jenkins JVM. If |
| 19 | +`JAVA_MAX_HEAP_PARAM` is set, its value takes |
| 20 | +precedence. Otherwise, the maximum heap size is dynamically calculated as |
| 21 | +`CONTAINER_HEAP_PERCENT` of the container |
| 22 | +memory limit, optionally capped at `JENKINS_MAX_HEAP_UPPER_BOUND_MB` MiB. |
| 23 | + |
| 24 | +By default, the maximum heap size of the Jenkins JVM is set to 50% of the |
| 25 | +container memory limit with no cap. |
| 26 | +|`JAVA_MAX_HEAP_PARAM` example setting: `-Xmx512m` |
| 27 | + |
| 28 | +`CONTAINER_HEAP_PERCENT` default: `0.5`, or 50% |
| 29 | + |
| 30 | +`JENKINS_MAX_HEAP_UPPER_BOUND_MB` example setting: `512 MiB` |
| 31 | + |
| 32 | +|`JAVA_INITIAL_HEAP_PARAM`, |
| 33 | +`CONTAINER_INITIAL_PERCENT` |
| 34 | +|These values control the initial heap size of the Jenkins JVM. If |
| 35 | +`JAVA_INITIAL_HEAP_PARAM` is set, its value takes |
| 36 | +precedence. Otherwise, the initial heap size is dynamically calculated as |
| 37 | +`CONTAINER_INITIAL_PERCENT` of the |
| 38 | +dynamically calculated maximum heap size. |
| 39 | + |
| 40 | +By default, the JVM sets the initial heap size. |
| 41 | +|`JAVA_INITIAL_HEAP_PARAM` example setting: `-Xms32m` |
| 42 | + |
| 43 | +`CONTAINER_INITIAL_PERCENT` example setting: `0.1`, or 10% |
| 44 | + |
| 45 | +|`CONTAINER_CORE_LIMIT` |
| 46 | +|If set, specifies an integer number of cores used for sizing numbers of internal |
| 47 | +JVM threads. |
| 48 | +|Example setting: `2` |
| 49 | + |
| 50 | +|`JAVA_TOOL_OPTIONS` |
| 51 | +|Specifies options to apply to all JVMs running in this container. It is not |
| 52 | +recommended to override this value. |
| 53 | +|Default: `-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true` |
| 54 | + |
| 55 | +|`JAVA_GC_OPTS` |
| 56 | +|Specifies Jenkins JVM garbage collection parameters. It is not recommended to |
| 57 | +override this value. |
| 58 | +|Default: `-XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90` |
| 59 | + |
| 60 | +|`JENKINS_JAVA_OVERRIDES` |
| 61 | +|Specifies additional options for the Jenkins JVM. These options are appended to |
| 62 | +all other options, including the Java options above, and can be used to override |
| 63 | +any of them, if necessary. Separate each additional option with a space; if any |
| 64 | +option contains space characters, escape them with a backslash. |
| 65 | +|Example settings: `-Dfoo -Dbar`; `-Dfoo=first\ value -Dbar=second\ value` |
| 66 | + |
| 67 | +|=== |
0 commit comments