Skip to content

Commit b34134e

Browse files
committed
fix: update Dockerfile optimize JVM options for better performance
1 parent 4765cb7 commit b34134e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

core/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ COPY target/plugins/lib/*.jar plugins/lib/
2323
ENV RHO='/mclient/connection-string->"mongodb://host.docker.internal";/http-listener/host->"0.0.0.0"'
2424

2525
# JDK 25 optimized for RESTHeart: low-latency REST API, 1-2 vCPU, 1-2GB container RAM
26-
# ZGC (generational) for predictable pause times with Virtual Threads and short-lived request objects
26+
# Default G1 GC is the best fit: MongoDB is the bottleneck, not the JVM.
27+
# ZGC would add CPU and memory overhead with no benefit when virtual threads
28+
# are mostly parked on I/O. G1 pause times are short enough at 1-2GB heaps.
2729
# NOTE: Graal JIT is enabled by default to support GraalVM polyglot plugin capabilities.
2830
# If you are not using polyglot plugins, adding -XX:-UseJVMCICompiler will reduce
2931
# compiler memory overhead significantly in constrained containers (recommended for <512Mi heap).
3032
ENTRYPOINT [ "java", \
3133
"-Dfile.encoding=UTF-8", \
3234
"--enable-native-access=ALL-UNNAMED", \
3335
"--sun-misc-unsafe-memory-access=allow", \
34-
"-XX:+UseZGC", \
35-
"-XX:+ZGenerational", \
3636
"-XX:MaxRAMPercentage=70.0", \
37-
"-XX:InitialRAMPercentage=25.0", \
37+
"-XX:InitialRAMPercentage=60.0", \
3838
"-XX:+DisableExplicitGC", \
3939
"-XX:+ExitOnOutOfMemoryError", \
4040
"-XX:+UseCompactObjectHeaders", \

0 commit comments

Comments
 (0)