Change-Id: Ib08e279880e264bca8d41565b52d7e2f540160a0
setmemorylimit() {
if test -n "$VM_IMAGE" -o -n "$RUNNING_IN_VM" ; then
- return
+ return
+ fi
+ arch=`uname -p`
+ if [ $arch == "x86_64" ];then
+ echo "on X86_64, no limit mem size"
+ return
fi
local mem
local limit
while read mem; do
- case "$mem" in
- MemTotal:*)
- set -- $mem
- eval "limit=\$(($2/3*4))"
- ;;
- SwapTotal:*)
- set -- $mem
- eval "limit=\$(($2/3*4+$limit))"
- ;;
- esac
+ case "$mem" in
+ MemTotal:*)
+ set -- $mem
+ eval "limit=\$(($2/3*4))"
+ ;;
+ SwapTotal:*)
+ set -- $mem
+ eval "limit=\$(($2/3*4+$limit))"
+ ;;
+ esac
done < <(cat /proc/meminfo) # cat for proc stuff
-
ulimit -v $limit
echo "Memory limit set to ${limit}KB"
}