JVM options for strings (#112)

This commit is contained in:
Jun Woo Shin
2022-10-28 13:15:19 -04:00
committed by GitHub
parent a54f9a48be
commit f031027684
2 changed files with 35 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ COPY runner.sh /
COPY --from=build /usr/src/java/owrrm/target/openwifi-rrm.jar /usr/local/bin/
EXPOSE 16789 16790
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/runner.sh", "/usr/local/bin/openwifi-rrm.jar", \
CMD ["/runner.sh", "java", "/usr/local/bin/openwifi-rrm.jar", \
"run", \
"--config-env", \
"-t", "/owrrm-data/topology.json", \

View File

@@ -1,11 +1,38 @@
#!/usr/bin/env sh
BIN=$1
shift 1
# script to help run the binary with specific jvm and jvm options
# Defaults to openj9. Switch by setting JVM_IMPL environment variable
echo $@
JAVA_BIN=$1
JAR=$2
shift 2
java \
-XX:+IdleTuningGcOnIdle -Xtune:virtualized \
-jar "$BIN" \
"$@"
COMMON_PARAMETERS=" \
-XX:+CompactStrings \
"
JVM_IMPL="${JVM_IMPL:-openj9}"
if [ "$JVM_IMPL" = "hotspot" ]; then
# for hotspot
PARAMETERS="\
$COMMON_PARAMETERS \
-XX:+UseG1GC \
-XX:+UseStringDeduplication \
"
elif [ "$JVM_IMPL" = "openj9" ]; then
# for openj9
PARAMETERS=" \
$COMMON_PARAMETERS \
-XX:+IdleTuningGcOnIdle \
-Xtune:virtualized
"
else
echo "Invalid JVM_IMPL option"
exit 1
fi
"$JAVA_BIN" \
$PARAMETERS \
-jar "$JAR" \
$@