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

View File

@@ -1,11 +1,38 @@
#!/usr/bin/env sh #!/usr/bin/env sh
BIN=$1 # script to help run the binary with specific jvm and jvm options
shift 1 # Defaults to openj9. Switch by setting JVM_IMPL environment variable
echo $@ JAVA_BIN=$1
JAR=$2
shift 2
java \ COMMON_PARAMETERS=" \
-XX:+IdleTuningGcOnIdle -Xtune:virtualized \ -XX:+CompactStrings \
-jar "$BIN" \ "
"$@"
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" \
$@