summaryrefslogtreecommitdiffstats
path: root/satellit_installer/static_files/dmsd/opt/dmsd/dmsd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_installer/static_files/dmsd/opt/dmsd/dmsd.sh')
-rwxr-xr-xsatellit_installer/static_files/dmsd/opt/dmsd/dmsd.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/satellit_installer/static_files/dmsd/opt/dmsd/dmsd.sh b/satellit_installer/static_files/dmsd/opt/dmsd/dmsd.sh
new file mode 100755
index 0000000..04994d3
--- /dev/null
+++ b/satellit_installer/static_files/dmsd/opt/dmsd/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