[Qa-jenkins-scm] [jenkins.debian.net] 01/01: limit diffoscope memory usage to 10GB virtual per process

Holger Levsen holger at layer-acht.org
Thu Jun 29 14:42:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 7e861d1c264bc82ac68ba7d83773e826f3a6ec41
Author: Helmut Grohne <helmut at subdivi.de>
Date:   Thu Jun 29 16:35:35 2017 +0200

    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 at layer-acht.org>
---
 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 2e68e4d..fa41901 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 -- \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list