Skip to content

Commit

Permalink
Potential fix for Lower XMX not applying
Browse files Browse the repository at this point in the history
  • Loading branch information
hwalker928 authored Apr 14, 2024
1 parent 92a4ddd commit 60674af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions java/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ echo "Java version: ${JAVA_VER}"
# Make internal Docker IP address available to processes
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace startup variables.
MODIFIED_STARTUP=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")

# Check if startup command has -Dterminal.jline=false -Dterminal.ansi=true
JLINE_ARGS=$(echo ${MODIFIED_STARTUP} | grep -o "\-Dterminal.jline=false -Dterminal.ansi=true")
TIMEZONE_INUSE=$(echo ${MODIFIED_STARTUP} | grep -o "\-Duser.timezone=")
Expand All @@ -25,6 +22,9 @@ if [ "${LOWER_XMX}" = 1 ]; then
if [ "${SERVER_MEMORY}" == 0 ]; then SERVER_MEMORY=512; fi
fi

# Replace startup variables.
MODIFIED_STARTUP=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")

# If Forge compatibility is enabled and above variable is empty, add the parameters to the startup command
if [ "${FORGE_COMPATIBILITY}" = 1 ] && [ -z "${JLINE_ARGS}" ] && [ -z "${FORGE_VERSION}" ]; then
MODIFIED_STARTUP=$(echo "${MODIFIED_STARTUP}" | sed -E 's/-Xmx([0-9]+)[KMG]?/& -Dterminal.jline=false -Dterminal.ansi=true/')
Expand Down

0 comments on commit 60674af

Please sign in to comment.