Cater to high ram systems

This commit is contained in:
Martin Wimpress 2021-09-06 15:31:07 +01:00
parent c368e7ee9e
commit 3124138e47
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -302,7 +302,13 @@ function vm_boot() {
local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g')
#Round up - https://github.com/wimpysworld/quickemu/issues/11
RAM_HOST=$(printf '%.*f\n' 0 ${RAM_HOST})
if [ ${RAM_HOST} -ge 64 ]; then
if [ ${RAM_HOST} -ge 256 ]; then
RAM_VM="32G"
elif [ ${RAM_HOST} -ge 128 ]; then
RAM_VM="16G"
elif [ ${RAM_HOST} -ge 64 ]; then
RAM_VM="8G"
elif [ ${RAM_HOST} -ge 32 ]; then
RAM_VM="4G"
elif [ ${RAM_HOST} -ge 16 ]; then
RAM_VM="3G"