summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-08-10 12:42:34 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-08-10 12:42:34 +0000
commit08087fad8e352f4aabf8c079c14615dda11d5065 (patch)
treee8f965b2b71a153b417401359f56b6ecf24eec89 /jenkins-helpers.sh
parent070eee025afce9841d5407a01bd2ab3e11348b6f (diff)
print_memory_limit: Make suitable for high-core-count machines
Allocate up to 30GB per container on high-core-count machines. This change doesn't affect APMs, TK1s and TX1s much. Change-Id: Ibde348b0f01d0e1d46dafc4e0dee3c5c0a0c4c0c
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 87d25e13..b1045c31 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -397,10 +397,20 @@ print_memory_limit ()
set -euf -o pipefail
local task="$1"
local weight="$2"
+ local nproc="$3"
local memory
case "$task" in
- build) memory=$(( $weight * 10000 )) ;; # 10GB per executor
- test) memory=$(( $weight * 750 )) ;; # 0.75GB per session
+ build)
+ # 1GB per compilation core
+ memory=$(( 1000 * $weight * $nproc ))
+ if [ "$memory" -gt "30000" ]; then
+ memory="30000"
+ fi
+ ;;
+ test)
+ # 0.75GB per session
+ memory=$(( 750 * $weight ))
+ ;;
esac
echo "$memory"
)