Skip to content

Commit 97e40dd

Browse files
authored
Merge pull request #1652 from wglambert/master
Update for 8u191 changes
2 parents 4a1d44a + ed611f4 commit 97e40dd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

openjdk/content.md

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

4242
## Make JVM respect CPU and RAM limits
4343

44-
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.
44+
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.
4545

46-
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:
46+
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.
4747

48-
```console
49-
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap ...
50-
```
51-
52-
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:
48+
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:
5349

5450
```console
5551
$ start /b /wait /affinity 0x3 path/to/java.exe ...
5652
```
5753

58-
In this example CPU affinity hex mask `0x3` will limit JVM to 2 CPU cores.
54+
In this example CPU affinity hex mask `0x3` will limit the JVM to 2 CPU cores.
5955

60-
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.
56+
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.
6157

6258
## Environment variables with periods in their names
6359

0 commit comments

Comments
 (0)