summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjingui.ren <jingui.ren@samsung.com>2018-06-21 16:49:43 +0800
committerjingui.ren <jingui.ren@samsung.com>2018-06-21 17:31:36 +0800
commitdfd1c6a407dfe625a9e6f178414ddc152ee28494 (patch)
tree1da5e8b5ef7abf8b7b26e0e38740887770be5025
parent35811e3151c524e235a9ba5271f3143375b39d7c (diff)
downloadbuild-dfd1c6a407dfe625a9e6f178414ddc152ee28494.tar.gz
build-dfd1c6a407dfe625a9e6f178414ddc152ee28494.tar.bz2
build-dfd1c6a407dfe625a9e6f178414ddc152ee28494.zip
when build on x86_64, no memory limit
Change-Id: Ib08e279880e264bca8d41565b52d7e2f540160a0
-rwxr-xr-xbuild28
1 files changed, 16 insertions, 12 deletions
diff --git a/build b/build
index fd11b70..fb572fe 100755
--- a/build
+++ b/build
@@ -516,23 +516,27 @@ setupicecream() {
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"
}