Skip to content

Commit 5c751fe

Browse files
Run update.sh
1 parent 97e40dd commit 5c751fe

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

openjdk/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,23 +194,19 @@ This will add your current directory as a volume to the container, set the worki
194194

195195
## Make JVM respect CPU and RAM limits
196196

197-
On startup JVM tries to detect the number of available CPU cores and the amount of RAM to adjust its internal parameters (like the number of garbage collector threads to spawn) accordingly. When container is run with limited CPU/RAM, standard system API, used by JVM for probing, will return host-wide values. This can cause excessive CPU usage and memory allocation errors with older versions of JVM.
197+
On startup the JVM tries to detect the number of available CPU cores and RAM to adjust its internal parameters (like the number of garbage collector threads to spawn) accordingly. When the container is ran with limited CPU/RAM then the standard system API used by the JVM for probing it will return host-wide values. This can cause excessive CPU usage and memory allocation errors with older versions of the JVM.
198198

199-
Inside Linux containers, OpenJDK versions 8 and later can correctly detect container-limited number of CPU cores and available RAM. In OpenJDK 11 this is turned on by default. In versions 8, 9, and 10 you have to enable the detection of container-limited amount of RAM using the following options:
199+
Inside Linux containers, OpenJDK versions 8 and later can correctly detect the container-limited number of CPU cores and available RAM. For all currently supported OpenJDK versions this is turned on by default.
200200

201-
```console
202-
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap ...
203-
```
204-
205-
Inside Windows Server (non-Hyper-V) containers, limit for number of available CPU cores does not work (is ignored by Host Compute Service). To set such limit manually, JVM can be started the following way:
201+
Inside Windows Server (non-Hyper-V) containers, the limit for the number of available CPU cores doesn't work (it's ignored by Host Compute Service). To set the limit manually the JVM can be started as:
206202

207203
```console
208204
$ start /b /wait /affinity 0x3 path/to/java.exe ...
209205
```
210206

211-
In this example CPU affinity hex mask `0x3` will limit JVM to 2 CPU cores.
207+
In this example CPU affinity hex mask `0x3` will limit the JVM to 2 CPU cores.
212208

213-
RAM limit is supported by Windows Server containers, but currently JVM cannot detect it. To prevent excessive memory allocations, `-XX:MaxRAM=...` option must be specified with the value that is not bigger than a containers RAM limit.
209+
RAM limit is supported by Windows Server containers, but currently the JVM cannot detect it. To prevent excessive memory allocations, `-XX:MaxRAM=...` option must be specified with the value that is not bigger than the containers RAM limit.
214210

215211
## Environment variables with periods in their names
216212

0 commit comments

Comments
 (0)