I'm trying to run a Jetty webserver on kubernetes, it needs an extremely huge amount of heap ~ 250 GB in our production environment, ~ 50 GB in our test environment.
I'm using jetty:9.4-jdk11
, I'm trying to avoid setting Xms
or Xmx
flags explicitly because the value is different between different environments, for that I thought depending on -XX:MaxRAMPercentage -XX:InitialRAMPercentage
would be much better, but no matter what I try I can't get the MaxHeapSize
to get past 32178700288 ~ 30 GB.
The Node which has only the Java app on it with a few tiny sidcars, has 64 GB of memory.
Dockerfile
FROM jetty:9.4-jdk11
ENV APP_WAR root.war
ENV APP_EXPLODED_WAR root/
ENV APP_DESTINATION_PATH $JETTY_BASE/webapps/
ENV APP_DESTINATION_WAR $APP_DESTINATION_PATH$APP_WAR
ENV APP_DESTINATION_EXPLODED_WAR $APP_DESTINATION_PATH$APP_EXPLODED_WAR
ADD . $APP_DESTINATION_EXPLODED_WAR
ENV JAVA_OPTIONS -XX:+PrintFlagsFinal -XX:MaxRAMPercentage=90 -XX:InitialRAMPercentage=90 -XX:-OmitStackTraceInFastThrow -XX:+UseStringDeduplication -Xlog:gc*,stringdedup*=debug:file=/tmp/gc.log:time
The container resources settings
resources:
limits:
cpu: "8"
memory: 60G
requests:
cpu: "6"
memory: 60G
Based on these values I should be getting 90% of 60 GB MaxHeapSize
~ 54 GB, not 30 GB.
Any idea what am I is missing ?