diff options
author | Simon Rettberg | 2024-02-07 18:12:03 +0100 |
---|---|---|
committer | Simon Rettberg | 2024-02-07 18:12:03 +0100 |
commit | e7f66772c4507af50516fa24b4441d9c36f18253 (patch) | |
tree | 28df5f90430553bf8d6b8d5559508769500f2fc7 /dozentenmodulserver | |
parent | [server] Tweak thrift call retry logic (diff) | |
download | tutor-module-e7f66772c4507af50516fa24b4441d9c36f18253.tar.gz tutor-module-e7f66772c4507af50516fa24b4441d9c36f18253.tar.xz tutor-module-e7f66772c4507af50516fa24b4441d9c36f18253.zip |
[server] Add startup script that tweaks -Xmx
Diffstat (limited to 'dozentenmodulserver')
-rwxr-xr-x | dozentenmodulserver/dmsd.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dozentenmodulserver/dmsd.sh b/dozentenmodulserver/dmsd.sh new file mode 100755 index 00000000..11b4dd52 --- /dev/null +++ b/dozentenmodulserver/dmsd.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +KB=$( grep ^MemTotal /proc/meminfo | awk '{print $2}' ) +[ -z "$KB" ] && KB=600000 +if [ "$KB" -gt 4096000 ]; then + MB=$(( KB / ( 1024 * 3 ) + 667 )) +else + MB=$(( KB / ( 1024 * 2 ) )) +fi +#if [ "$MB" -gt 2000 ] && ! java -version 2>&1 | grep -q '64-Bit'; then +# MB=2000 +#fi +[ "$MB" -lt 190 ] && MB=190 +[ "$MB" -gt 4500 ] && MB=4500 + +exec java -Xmx${MB}M -jar dmsd.jar |