You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-write the handling of JAVA_MAX_MEM_RATIO to set -XX:MaxRAMPercentage,
rather than try to set -Xmx and do calculations based on cgroups memory
limits (leave that up to the JVM)
Re-write JAVA_INITIAL_MEM_RATIO similarly. Do not specify a default
value for JAVA_INITIAL_MEM_RATIO: only handle it if the user sets it.
Since this is just a thin wrapper around setting
-XX:InitialRAMPercentage directly, the user can achieve this directly
with JAVA_OPTS. Mark this as deprecated, to be removed in a future
release.
Re-write the handling of JAVA_MAX_MEM_RATIO. Do not set a default
value. If the user specifies a value, map it directly to -Xms. As
with JAVA_INITIAL_MEM_RATIO, this can be achieved directly using
JAVA_OPTS, so mark this as deprecated for removal in a future
release.
If JAVA_MAX_INITIAL_MEM (-Xms) is set, then -XX:InitialRAMPercentage
would be ignored, so do not set it.
We are now no longer using any value derived from interpreting
cgroups v1 files, so remove the container-limits script entirely
and all references to CONTAINER_MAX_MEMORY or CONTAINER_CORE_LIMIT.
Add tests for the default and configured values.
Signed-off-by: Jonathan Dowland <[email protected]>
Copy file name to clipboardExpand all lines: modules/jvm/api/module.yaml
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,22 @@ envs:
14
14
description: User specified Java options to be appended to generated options in JAVA_OPTS.
15
15
example: "-Dsome.property=foo"
16
16
- name: JAVA_MAX_MEM_RATIO
17
-
description: Is used when no `-Xmx` option is given in **JAVA_OPTS**. This is used to calculate a default maximal heap memory based on a containers restriction. If used in a container without any memory constraints for the container then this option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio of the container available memory as set here. The default is `50` which means 50% of the available memory is used as an upper boundary. You can skip this mechanism by setting this value to `0` in which case no `-Xmx` option is added.
17
+
description: Specify the maximum heap memory. Corresponds to the JVM argument `-XX:MaxRAMPercentage`. The default is `80.0` which means 80% of the available memory. You can disable this mechanism by setting the value to `0`.
18
+
example: "90.0"
18
19
- name: JAVA_INITIAL_MEM_RATIO
19
-
description: Is used when no `-Xms` option is given in **JAVA_OPTS**. This is used to calculate a default initial heap memory based on the maximum heap memory. If used in a container without any memory constraints for the container then this option has no effect. If there is a memory constraint then `-Xms` is set to a ratio of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` is used as the initial heap size. You can skip this mechanism by setting this value to `0` in which case no `-Xms` option is added.
20
-
example: "25"
20
+
description:
21
+
Specify the initial heap memory. Corresponds to the JVM argument
22
+
`-XX:InitialRAMPercentage`. By default this is not specified.
23
+
**This is deprecated and will be removed in a future release. Users should
24
+
specify `-XX:InitialRAMPercentage` directly in JAVA_OPTS instead.**
25
+
example: "25.0"
21
26
- name: JAVA_MAX_INITIAL_MEM
22
-
description: Is used when no `-Xms` option is given in **JAVA_OPTS**. This is used to calculate the maximum value of the initial heap memory. If used in a container without any memory constraints for the container then this option has no effect. If there is a memory constraint then `-Xms` is limited to the value set here. The default is 4096MB which means the calculated value of `-Xms` never will be greater than 4096MB. The value of this variable is expressed in MB.
23
-
example: "4096"
27
+
description:
28
+
This value is passed through to the `-Xms` Java option, setting both the
29
+
minimum and initial heap size. By default this is unset.
30
+
**This is deprecated and will be removed in a future release. Users should
31
+
specify `-Xms` directly in JAVA_OPTS instead.**
32
+
example: "4096m"
24
33
- name: JAVA_DIAGNOSTICS
25
34
description: Set this to get some diagnostics information to standard output when things are happening. **Note:** This option, if set to true, will set `-XX:+UnlockDiagnosticVMOptions`. **Disabled by default.**
26
35
example: "true"
@@ -30,9 +39,6 @@ envs:
30
39
- name: JAVA_DEBUG_PORT
31
40
description: Port used for remote debugging. Defaults to *5005*.
32
41
example: "8787"
33
-
- name: CONTAINER_MAX_MEMORY
34
-
description: Memory limit given to the container.
35
-
example: "1024"
36
42
- name: GC_MIN_HEAP_FREE_RATIO
37
43
description: Minimum percentage of heap free after GC to avoid expansion.
0 commit comments