From 12b2f18a0b98408bb48078faf6d8f9f39f184803 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Thu, 6 Feb 2020 10:42:48 +0100 Subject: [PATCH 1/6] jvm: set a var for XX:ReservedCodeCacheSize Signed-off-by: Yoan Blanc --- Dockerfile | 3 ++- README.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4dfd8c1..99e26ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,8 @@ RUN groupadd --gid ${RUN_GID} ${RUN_GROUP} \ && chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_INSTALL_DIR}/work \ && chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_HOME} \ \ - && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh + && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \ + && sed -i -e 's/\(-XX:ReservedCodeCacheSize=)\([0-9]\+[kmg]\)/\1${JVM_RESERVED_CODE_CACHE_SIZE:=\2}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh VOLUME ["${CONFLUENCE_HOME}"] # Must be declared after setting perms diff --git a/README.md b/README.md index 2f2548d..a22272e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,10 @@ variables. The maximum heap size of the JVM +* `JVM_RESERVED_CODE_CACHE_SIZE` (default: 256m) + + The reserved code cache size of the JVM + ## Tomcat and Reverse Proxy Settings If Confluence is run behind a reverse proxy server (e.g. a load-balancer or From 3dffa2be828b236ae3848a8bf0d2122acaaea23f Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Thu, 6 Feb 2020 11:08:07 +0100 Subject: [PATCH 2/6] fixup! jvm: set a var for XX:ReservedCodeCacheSize Signed-off-by: Yoan Blanc --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 99e26ba..679fa36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,7 @@ RUN groupadd --gid ${RUN_GID} ${RUN_GROUP} \ && chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_HOME} \ \ && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \ - && sed -i -e 's/\(-XX:ReservedCodeCacheSize=)\([0-9]\+[kmg]\)/\1${JVM_RESERVED_CODE_CACHE_SIZE:=\2}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh + && sed -i -e 's/\(-XX:ReservedCodeCacheSize=\)\([0-9]\+[kmg]\)/\1${JVM_RESERVED_CODE_CACHE_SIZE:=\2}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh VOLUME ["${CONFLUENCE_HOME}"] # Must be declared after setting perms From 05228aa72c3cbe33e6495bc5f419fc08cefa8579 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Thu, 6 Feb 2020 12:43:20 +0100 Subject: [PATCH 3/6] fixup! fixup! jvm: set a var for XX:ReservedCodeCacheSize Signed-off-by: Yoan Blanc --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 679fa36..6a07542 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,7 @@ RUN groupadd --gid ${RUN_GID} ${RUN_GROUP} \ && chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_HOME} \ \ && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \ - && sed -i -e 's/\(-XX:ReservedCodeCacheSize=\)\([0-9]\+[kmg]\)/\1${JVM_RESERVED_CODE_CACHE_SIZE:=\2}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh + && sed -i -e 's/-XX:ReservedCodeCacheSize=\([0-9]\+[kmg]\)/-XX:ReservedCodeCacheSize=${JVM_RESERVED_CODE_CACHE_SIZE:=\1}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh VOLUME ["${CONFLUENCE_HOME}"] # Must be declared after setting perms From 5baee79ee2960724248795be9574461ebb729b1b Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Fri, 7 Feb 2020 09:03:25 +0100 Subject: [PATCH 4/6] test: JVM_RESERVED_CODE_CACHE_SIZE env Signed-off-by: Yoan Blanc --- tests/test_image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_image.py b/tests/test_image.py index 9e71134..9a64e27 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -9,6 +9,7 @@ def test_jvm_args(docker_cli, image, run_user): environment = { 'JVM_MINIMUM_MEMORY': '383m', 'JVM_MAXIMUM_MEMORY': '2047m', + 'JVM_RESERVED_CODE_CACHE_SIZE': '384m', 'JVM_SUPPORT_RECOMMENDED_ARGS': '-verbose:gc', } container = run_image(docker_cli, image, user=run_user, environment=environment) @@ -19,6 +20,7 @@ def test_jvm_args(docker_cli, image, run_user): assert f'-Xms{environment.get("JVM_MINIMUM_MEMORY")}' in jvm assert f'-Xmx{environment.get("JVM_MAXIMUM_MEMORY")}' in jvm + assert f'-XX:ReservedCodeCacheSize={environment.get("JVM_RESERVED_CODE_CACHE_SIZE")}' in jvm assert environment.get('JVM_SUPPORT_RECOMMENDED_ARGS') in jvm From 2aab7496c385ed2299c4be351eb86bc47a2f7655 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Fri, 7 Feb 2020 15:15:42 +0100 Subject: [PATCH 5/6] fixup! test: JVM_RESERVED_CODE_CACHE_SIZE env Signed-off-by: Yoan Blanc --- tests/test_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_image.py b/tests/test_image.py index 9a64e27..895e559 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -9,7 +9,7 @@ def test_jvm_args(docker_cli, image, run_user): environment = { 'JVM_MINIMUM_MEMORY': '383m', 'JVM_MAXIMUM_MEMORY': '2047m', - 'JVM_RESERVED_CODE_CACHE_SIZE': '384m', + 'JVM_RESERVED_CODE_CACHE_SIZE': '383m', 'JVM_SUPPORT_RECOMMENDED_ARGS': '-verbose:gc', } container = run_image(docker_cli, image, user=run_user, environment=environment) From 3162d284a45a061a21ace3b0dc6793ab484484a5 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Tue, 11 Feb 2020 10:35:38 +0100 Subject: [PATCH 6/6] docker: XX:ReservedCodeCacheSize for alpine too Signed-off-by: Yoan Blanc --- Dockerfile-alpine | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile-alpine b/Dockerfile-alpine index c5b5f7e..653b6e1 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -41,7 +41,8 @@ RUN addgroup -g ${RUN_GID} ${RUN_GROUP} \ && chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_INSTALL_DIR}/work \ && chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_HOME} \ \ - && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh + && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \ + && sed -i -e 's/-XX:ReservedCodeCacheSize=\([0-9]\+[kmg]\)/-XX:ReservedCodeCacheSize=${JVM_RESERVED_CODE_CACHE_SIZE:=\1}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh VOLUME ["${CONFLUENCE_HOME}"] # Must be declared after setting perms