From 81994ec3b3fd15d76825b619fb87f1d92c0873c6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 1 Nov 2021 17:23:45 -0500 Subject: [PATCH] docs: described using MaxRAMPercentage when MEMORY is unset --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d34486a9..b14f8ffb 100644 --- a/README.md +++ b/README.md @@ -1288,7 +1288,9 @@ The values of all three are passed directly to the JVM and support format/units -e MEMORY=2G -> To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. +To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit; however, as an example the following would tell the JVM to use 75% of the container limit of 2GB of memory: + + -e MEMORY="" -e JVM_XX_OPTS="-XX:MaxRAMPercentage=75" -m 2000M > The settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container).