diff options
author | Helmut Grohne <helmut@subdivi.de> | 2017-06-29 16:35:35 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-06-29 16:41:59 +0200 |
commit | 7e861d1c264bc82ac68ba7d83773e826f3a6ec41 (patch) | |
tree | 305cf152ce5cb2304d76c88b6bec54af106a18bc /bin | |
parent | a74682bf7c3c86113775e073a931fc766761e913 (diff) | |
download | jenkins.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>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_common.sh | 9 |
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 -- \ |