From c45d1583e0d6dcc49d422bd4038e6bbdc6da5822 Mon Sep 17 00:00:00 2001 From: Alex Nederlof Date: Sun, 18 Nov 2018 12:32:26 +0100 Subject: [PATCH 1/3] Update Memory settings documentation for Java 11 Since Java 11, the `UseCGroupMemoryLimitForHeap` is removed, and enabled by default. See https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID-3B1CE181-CD30-4178-9602-230B800D4FAE I've updated the docs to reflect this. --- openjdk/content.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openjdk/content.md b/openjdk/content.md index 75300040c..15f96263b 100644 --- a/openjdk/content.md +++ b/openjdk/content.md @@ -43,12 +43,13 @@ This will add your current directory as a volume to the container, set the worki 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. -Inside Linux containers, recent versions of OpenJDK 8 can correctly detect container-limited number of CPU cores by default. To enable the detection of container-limited amount of RAM the following options can be used: +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 following the following options: ```console $ java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap ... ``` + 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: ```console From aa4f737645ab97b5b1eacd6e08b09f3c400a78a7 Mon Sep 17 00:00:00 2001 From: Alex Nederlof Date: Sun, 18 Nov 2018 12:33:34 +0100 Subject: [PATCH 2/3] Fix typo in documentation --- openjdk/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjdk/content.md b/openjdk/content.md index 15f96263b..c1fbdb0c9 100644 --- a/openjdk/content.md +++ b/openjdk/content.md @@ -43,7 +43,7 @@ This will add your current directory as a volume to the container, set the worki 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. -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 following the following options: +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: ```console $ java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap ... From 2ab08e4ff1be9fa2674ce03f56410670d8bba19f Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 19 Nov 2018 07:31:59 -0800 Subject: [PATCH 3/3] Fix formatting (should satisfy Travis) --- openjdk/content.md | 1 - 1 file changed, 1 deletion(-) diff --git a/openjdk/content.md b/openjdk/content.md index c1fbdb0c9..d854a9923 100644 --- a/openjdk/content.md +++ b/openjdk/content.md @@ -49,7 +49,6 @@ Inside Linux containers, OpenJDK versions 8 and later can correctly detect conta $ java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap ... ``` - 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: ```console