summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/dmsd.sh
blob: 11b4dd528ae8070d268223f45bc71a716d030ba1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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