use openj9 as the Java runtime to reduce memory usage

This commit is contained in:
Athou
2024-07-13 11:06:45 +02:00
parent dc526316a0
commit 9134f36d3b
2 changed files with 12 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
FROM eclipse-temurin:21.0.3_9-jre FROM ibm-semeru-runtimes:open-21-jre
EXPOSE 8082 EXPOSE 8082
@@ -8,5 +8,5 @@ VOLUME /commafeed/data
COPY commafeed-server/config.yml.example config.yml COPY commafeed-server/config.yml.example config.yml
COPY commafeed-server/target/commafeed.jar . COPY commafeed-server/target/commafeed.jar .
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 ENV JAVA_TOOL_OPTIONS -Djava.net.preferIPv4Stack=true -Xtune:virtualized -Xminf0.05 -Xmaxf0.1
CMD ["java", "-jar", "commafeed.jar", "server", "config.yml"] CMD ["java", "-jar", "commafeed.jar", "server", "config.yml"]

View File

@@ -58,7 +58,7 @@ user is `admin` and the default password is `admin`.
The Java Virtual Machine (JVM) is rather greedy by default and will not release unused memory to the The Java Virtual Machine (JVM) is rather greedy by default and will not release unused memory to the
operating system. This is because acquiring memory from the operating system is a relatively expensive operation. operating system. This is because acquiring memory from the operating system is a relatively expensive operation.
However, this can be problematic on systems with limited memory. This can be problematic on systems with limited memory.
#### Hard limit #### Hard limit
@@ -77,6 +77,15 @@ and [here](https://docs.oracle.com/en/java/javase/17/gctuning/factors-affecting-
more more
information. information.
#### OpenJ9
The [OpenJ9](https://eclipse.dev/openj9/) JVM is a more memory-efficient alternative to the HotSpot JVM, at the cost of
slightly slower throughput.
IBM provides precompiled binaries for OpenJ9
named [Semeru](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/).
This is the JVM used in the [Docker image](https://github.com/Athou/commafeed/blob/master/Dockerfile).
## Translation ## Translation
Files for internationalization are Files for internationalization are