summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2017-06-29 16:35:35 +0200
committerHolger Levsen <holger@layer-acht.org>2017-06-29 16:41:59 +0200
commit7e861d1c264bc82ac68ba7d83773e826f3a6ec41 (patch)
tree305cf152ce5cb2304d76c88b6bec54af106a18bc
parenta74682bf7c3c86113775e073a931fc766761e913 (diff)
downloadjenkins.debian.net-7e861d1c264bc82ac68ba7d83773e826f3a6ec41.tar.xz
limit diffoscope memory usage to 10GB virtual per process
It currently tends to use 50GB virtual, 36GB resident. That's bad for everything else. Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-xbin/reproducible_common.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 2e68e4da..fa419019 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -58,6 +58,9 @@ RPM_PKGS=/srv/reproducible-results/.rpm_pkgs
# number of cores to be used
NUM_CPU=$(grep -c '^processor' /proc/cpuinfo)
+# diffoscope memory limit in kilobytes
+DIFFOSCOPE_VIRT_LIMIT=$((10*1024*1024))
+
# we only this array for html creation but we cannot declare them in a function
declare -A SPOKENTARGET
@@ -560,7 +563,8 @@ call_diffoscope() {
local msg=""
set +e
# remember to also modify the retry diffoscope call 15 lines below
- ( timeout $TIMEOUT nice schroot \
+ ( ulimit -v "$DIFFOSCOPE_VIRT_LIMIT"
+ timeout "$TIMEOUT" nice schroot \
--directory $TMPDIR \
-c source:jenkins-reproducible-${DBDSUITE}-diffoscope \
diffoscope -- \
@@ -575,7 +579,8 @@ call_diffoscope() {
echo "$(date -u) - schroot jenkins-reproducible-${DBDSUITE}-diffoscope not available, will sleep 2min and retry."
sleep 2m
# remember to also modify the retry diffoscope call 15 lines above
- ( timeout $TIMEOUT nice schroot \
+ ( ulimit -v "$DIFFOSCOPE_VIRT_LIMIT"
+ timeout "$TIMEOUT" nice schroot \
--directory $TMPDIR \
-c source:jenkins-reproducible-${DBDSUITE}-diffoscope \
diffoscope -- \