diff --git a/grobid-home/pdfalto/lin-64/pdfalto_server b/grobid-home/pdfalto/lin-64/pdfalto_server index 07a99f220a..db8d9f15bd 100755 --- a/grobid-home/pdfalto/lin-64/pdfalto_server +++ b/grobid-home/pdfalto/lin-64/pdfalto_server @@ -6,7 +6,7 @@ timeout=20 # 20 seconds interval=1 # Delay between posting the SIGTERM signal and destroying the process by SIGKILL. delay=0 -# Limit the memory usage by this bash script +# Default limit for the memory usage by this bash script memory_limit=6242304 command=${0:0:${#0}-7} diff --git a/grobid-home/pdfalto/mac-64/pdfalto_server b/grobid-home/pdfalto/mac-64/pdfalto_server index 07f1b001cb..8fa2fafa78 100755 --- a/grobid-home/pdfalto/mac-64/pdfalto_server +++ b/grobid-home/pdfalto/mac-64/pdfalto_server @@ -6,8 +6,10 @@ timeout=20 # 20 seconds interval=1 # Delay between posting the SIGTERM signal and destroying the process by SIGKILL. delay=0 -command=${0:0:${#0}-7} +# Default limit for the memory usage by this bash script +memory_limit=6242304 +command=${0:0:${#0}-7} args=("$@") pdfalto_params=() @@ -17,12 +19,19 @@ for ((n=0; n<="$#";n++)); do timeout=${args[n+1]} ((n++)) ;; + --ulimit) + memory_limit=${args[n+1]} + ((n++)) + ;; *) pdfalto_params+=" ${args[n]}" ;; esac done +# Limit the memory usage by this bash script +ulimit -Sv $memory_limit + # kill -0 pid Exit code indicates if a signal may be sent to $pid process. ( ((t = timeout))