From 7e861d1c264bc82ac68ba7d83773e826f3a6ec41 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 29 Jun 2017 16:35:35 +0200 Subject: 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 --- bin/reproducible_common.sh | 9 +++++++-- 1 file 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 -- \ -- cgit v1.2.3-54-g00ecf