From dc526316a006de9b6b5fb8d880aa539ef2689465 Mon Sep 17 00:00:00 2001 From: Athou Date: Sat, 13 Jul 2024 10:25:32 +0200 Subject: [PATCH] enable string deduplication to reduce memory usage --- Dockerfile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 822141da..af504886 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,5 +8,5 @@ VOLUME /commafeed/data COPY commafeed-server/config.yml.example config.yml COPY commafeed-server/target/commafeed.jar . -ENV JAVA_TOOL_OPTIONS -Djava.net.preferIPv4Stack=true -Xms20m -XX:+UseG1GC -XX:-ShrinkHeapInSteps -XX:G1PeriodicGCInterval=10000 -XX:-G1PeriodicGCInvokesConcurrent -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 +ENV JAVA_TOOL_OPTIONS -Djava.net.preferIPv4Stack=true -Xms20m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:-ShrinkHeapInSteps -XX:G1PeriodicGCInterval=10000 -XX:-G1PeriodicGCInvokesConcurrent -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 CMD ["java", "-jar", "commafeed.jar", "server", "config.yml"] diff --git a/README.md b/README.md index 5b2c4722..6037d219 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ For example, to limit the JVM to 256MB of memory, use `-Xmx256m`. The JVM can be configured to release unused memory to the operating system with the following parameters: - -Xms20m -XX:+UseG1GC -XX:-ShrinkHeapInSteps -XX:G1PeriodicGCInterval=10000 -XX:-G1PeriodicGCInvokesConcurrent -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 + -Xms20m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:-ShrinkHeapInSteps -XX:G1PeriodicGCInterval=10000 -XX:-G1PeriodicGCInvokesConcurrent -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 This is how the Docker image is configured. See [here](https://docs.oracle.com/en/java/javase/17/gctuning/garbage-first-g1-garbage-collector1.html)