From 0a77194d4d6f7dc9dd7843234ca9cb84083a1f07 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 9 Jun 2021 15:35:15 +0200 Subject: Allow -Xmx to be specified as an argument to vespa-visit --- vespaclient-java/src/main/sh/vespa-visit.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'vespaclient-java') diff --git a/vespaclient-java/src/main/sh/vespa-visit.sh b/vespaclient-java/src/main/sh/vespa-visit.sh index 92d6bc67f3f..bcabf40c5c7 100755 --- a/vespaclient-java/src/main/sh/vespa-visit.sh +++ b/vespaclient-java/src/main/sh/vespa-visit.sh @@ -74,16 +74,30 @@ findhost # END environment bootstrap section +# Allow -Xmx to be specified in args +for arg in "$@"; do + shift + if case $arg in -Xmx*) true;; *) false;; esac; then # portable if [string begins with] + export Xmx=$arg + else + set -- "$@" "$arg" + fi +done + +if [ "${VESPA_LOG_LEVEL}" = "" ]; then + export VESPA_LOG_LEVEL=error,warning +fi + if [ "${VESPA_LOG_LEVEL}" = "" ]; then export VESPA_LOG_LEVEL=error,warning fi -export MALLOC_ARENA_MAX=1 #Does not need fast allocation -exec java \ +export MALLOC_ARENA_MAX=1 # Does not need fast allocation +echo exec java \ -server -enableassertions \ -XX:ThreadStackSize=512 \ -XX:MaxJavaStackTraceDepth=1000000 \ -Djava.library.path=${VESPA_HOME}/libexec64/native:${VESPA_HOME}/lib64 \ -XX:MaxDirectMemorySize=32m -Djava.awt.headless=true \ --Xms128m -Xmx1024m $(getJavaOptionsIPV46) \ +-Xms128m -Xmx1024m $(getJavaOptionsIPV46) ${Xmx} \ -cp ${VESPA_HOME}/lib/jars/vespaclient-java-jar-with-dependencies.jar com.yahoo.vespavisit.VdsVisit "$@" -- cgit v1.2.3