Skip to content

Commit f3497e3

Browse files
authored
[Feature] Support customizing JVM memory options via JVM_OPTS environment variable (#4545)
1 parent f544faf commit f3497e3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

deploy/docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ARG FLINK_VERSION
77
ENV FLINK_VERSION=${FLINK_VERSION}
88
ENV DINKY_HOME=/opt/dinky/
99
ENV H2_DB=./tmp/db/h2
10+
ENV JVM_OPTS="-XX:+UseContainerSupport -XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0"
1011

1112

1213
USER root
@@ -18,7 +19,7 @@ ADD build/dist/ /opt/dinky/config/static
1819
WORKDIR /opt/dinky/
1920

2021

21-
RUN mkdir /opt/dinky/customJar && chmod -R 777 /opt/dinky/ && sed -i 's/-Xms512M -Xmx2048M -XX:PermSize=512M/-XX:+UseContainerSupport -XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0/g' ./bin/auto.sh
22+
RUN mkdir /opt/dinky/customJar && chmod -R 777 /opt/dinky/
2223

2324
EXPOSE 8888
2425

script/bin/auto.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ JAR_PARAMS_OPT="--logging.config=${LOG_CONFIG}"
180180
# JMX path
181181
JMX="-javaagent:$APP_HOME/lib/jmx_prometheus_javaagent-0.20.0.jar=10087:$APP_HOME/config/jmx/jmx_exporter_config.yaml"
182182
#JVM OPTS
183-
JVM_OPTS="-Xms512M -Xmx2048M -XX:PermSize=512M -XX:MaxPermSize=1024M"
183+
JVM_OPTS="${JVM_OPTS:--Xms512M -Xmx2048M -XX:PermSize=512M -XX:MaxPermSize=1024M}"
184184

185185
# Check whether the pid path exists
186186
PID_PATH="${APP_HOME}/run"

0 commit comments

Comments
 (0)