Fix CLI setting for memory size (-m and /m) (#4266)

* Let the -m (UNIX) and /m (Windows) options steer both the min and max memory settings.

This is a more reliable fix for #388 (#2490).

Closes #4265.

* Do the same on Windows
This commit is contained in:
Antonin Delpeuch 2021-11-07 09:59:08 +01:00 committed by GitHub
parent 782ebf1a03
commit 41c7b70e55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 14 deletions

15
refine
View File

@ -47,8 +47,7 @@ where [options] include:
default: OS dependent default: OS dependent
-m <memory> max memory heap size to use -m <memory> max memory heap size to use
default: 1024M default: 1400M
Values less than 256M not allowed
-v <level> verbosity level [from low to high: error,warn,info,debug,trace] -v <level> verbosity level [from low to high: error,warn,info,debug,trace]
default: info default: info
@ -847,16 +846,8 @@ while [ $# -ne 0 ] ; do
-i) shift; REFINE_INTERFACE="$1"; shift; continue;; -i) shift; REFINE_INTERFACE="$1"; shift; continue;;
-w) shift; REFINE_WEBAPP="$1"; shift; continue;; -w) shift; REFINE_WEBAPP="$1"; shift; continue;;
-d) shift; REFINE_DATA_DIR="$1"; shift; continue;; -d) shift; REFINE_DATA_DIR="$1"; shift; continue;;
-m) -m) shift; REFINE_MEMORY="$1"; REFINE_MIN_MEMORY="$1"; shift; continue;;
shift; -k) shift; REFINE_GOOGLE_API_KEY="$1"; shift; continue;;
if [ $1 -le 256 ]
then
fail "Value of -m less than 256 not allowed";
else
REFINE_MEMORY="$1";
shift;
continue;
fi;;
-v) shift; REFINE_VERBOSITY="$1"; shift; continue;; -v) shift; REFINE_VERBOSITY="$1"; shift; continue;;
-x) shift; REFINE_EXTRA_OPTS="$1"; shift; continue;; -x) shift; REFINE_EXTRA_OPTS="$1"; shift; continue;;
--debug) shift; add_option '-Xdebug' '-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n'; continue;; --debug) shift; add_option '-Xdebug' '-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n'; continue;;

View File

@ -40,7 +40,7 @@ echo.
echo "/d" enable JVM debugging (on port 8000) echo "/d" enable JVM debugging (on port 8000)
echo. echo.
echo "/m <memory>" max memory heap size to use echo "/m <memory>" max memory heap size to use
echo default: 1024M echo default: 1400M
echo. echo.
echo "/x" enable JMX monitoring (for jconsole and friends) echo "/x" enable JMX monitoring (for jconsole and friends)
echo. echo.
@ -130,6 +130,7 @@ goto shift2loop
:arg-m :arg-m
set REFINE_MEMORY=%2 set REFINE_MEMORY=%2
set REFINE_MIN_MEMORY=%2
goto shift2loop goto shift2loop
:arg-d :arg-d
@ -155,7 +156,7 @@ set JAVA_OPTIONS=
set OPTS=%OPTS% %JAVA_OPTIONS% set OPTS=%OPTS% %JAVA_OPTIONS%
if not "%REFINE_MEMORY%" == "" goto gotMemory if not "%REFINE_MEMORY%" == "" goto gotMemory
set REFINE_MEMORY=1024M set REFINE_MEMORY=1400M
if not "%REFINE_MIN_MEMORY%" == "" goto gotMemory if not "%REFINE_MIN_MEMORY%" == "" goto gotMemory
set REFINE_MIN_MEMORY=256M set REFINE_MIN_MEMORY=256M