message notification of the free RAM. Issue #1295
This commit is contained in:
parent
a53467f2cb
commit
d10eb388a7
12
refine
12
refine
@ -934,6 +934,18 @@ if [ -z "$REFINE_MIN_MEMORY" ] ; then
|
|||||||
fi
|
fi
|
||||||
add_option "-Xms$REFINE_MIN_MEMORY -Xmx$REFINE_MEMORY -Drefine.memory=$REFINE_MEMORY"
|
add_option "-Xms$REFINE_MIN_MEMORY -Xmx$REFINE_MEMORY -Drefine.memory=$REFINE_MEMORY"
|
||||||
|
|
||||||
|
freeRam=UNKNOWN
|
||||||
|
if [ "$OS" = "macosx" ] ; then
|
||||||
|
freeRam=$(top -l 1 | grep PhysMem | awk '{print $6}' | tr -d M)
|
||||||
|
elif [ "$OS" = "linux" ] ; then
|
||||||
|
freeRam=$(free -m | grep -oP '\d+' | head -n 1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo You have "$freeRam"M of free memory.
|
||||||
|
echo You current configuration will allow to use $REFINE_MEMORY of memory.
|
||||||
|
echo OpenRefine can run better when given more memory. Read our FAQ on how to allocate more memory here:
|
||||||
|
echo https://github.com/OpenRefine/OpenRefine/wiki/FAQ:-Allocate-More-Memory
|
||||||
|
|
||||||
if [ -z "$REFINE_MAX_FORM_CONTENT_SIZE" ] ; then
|
if [ -z "$REFINE_MAX_FORM_CONTENT_SIZE" ] ; then
|
||||||
REFINE_MAX_FORM_CONTENT_SIZE="1048576"
|
REFINE_MAX_FORM_CONTENT_SIZE="1048576"
|
||||||
fi
|
fi
|
||||||
|
10
refine.bat
10
refine.bat
@ -137,9 +137,19 @@ if not "%REFINE_MEMORY%" == "" goto gotMemory
|
|||||||
set REFINE_MEMORY=1024M
|
set REFINE_MEMORY=1024M
|
||||||
if not "%REFINE_MIN_MEMORY%" == "" goto gotMemory
|
if not "%REFINE_MIN_MEMORY%" == "" goto gotMemory
|
||||||
set REFINE_MIN_MEMORY=256M
|
set REFINE_MIN_MEMORY=256M
|
||||||
|
|
||||||
:gotMemory
|
:gotMemory
|
||||||
set OPTS=%OPTS% -Xms%REFINE_MIN_MEMORY% -Xmx%REFINE_MEMORY% -Drefine.memory=%REFINE_MEMORY%
|
set OPTS=%OPTS% -Xms%REFINE_MIN_MEMORY% -Xmx%REFINE_MEMORY% -Drefine.memory=%REFINE_MEMORY%
|
||||||
|
|
||||||
|
rem --- Check free memory ---------------------------------------------
|
||||||
|
for /f "usebackq skip=1 tokens=*" %%i in (`wmic os get FreePhysicalMemory ^| findstr /r /v "^$"`) do @set /A freeRam=%%i/1024
|
||||||
|
|
||||||
|
echo You have %freeRam%M of free memory.
|
||||||
|
echo You current configuration will allow to use %REFINE_MEMORY% of memory.
|
||||||
|
echo OpenRefine can run better when given more memory. Read our FAQ on how to allocate more memory here:
|
||||||
|
echo https://github.com/OpenRefine/OpenRefine/wiki/FAQ:-Allocate-More-Memory
|
||||||
|
echo .
|
||||||
|
|
||||||
if not "%REFINE_MAX_FORM_CONTENT_SIZE%" == "" goto gotMaxFormContentSize
|
if not "%REFINE_MAX_FORM_CONTENT_SIZE%" == "" goto gotMaxFormContentSize
|
||||||
set REFINE_MAX_FORM_CONTENT_SIZE=1048576
|
set REFINE_MAX_FORM_CONTENT_SIZE=1048576
|
||||||
:gotMaxFormContentSize
|
:gotMaxFormContentSize
|
||||||
|
Loading…
Reference in New Issue
Block a user