From a5d874f2301827b59e4494ca2246d5de0a20882e32bcc75c65e9798df5484b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 7 Apr 2018 15:58:09 +0000 Subject: [PATCH 1/2] OBS-URL: https://build.opensuse.org/package/show/network:chromium/memory-constraints?expand=0&rev=13 --- memory-constraints.macros | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-constraints.macros b/memory-constraints.macros index 8cb2ca7..689a28e 100644 --- a/memory-constraints.macros +++ b/memory-constraints.macros @@ -19,7 +19,7 @@ max_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) \ max_jobs="$(($max_mem / ($mem_per_process * 1000)))" \ test "$_threads" -gt "$max_jobs" && _threads="$max_jobs" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" \ - test "$_threads" -le 0 && $_threads=1 && echo "Warning: Do not use the parallel build at all because of memory limits" \ + test "$_threads" -le 0 && _threads=1 && echo "Warning: Do not use the parallel build at all because of memory limits" \ fi \ %global jobs $([[ -n $_threads ]] && echo $_threads || echo "`/usr/bin/getconf _NPROCESSORS_ONLN`") \ %global _smp_mflags $([[ -n $_threads ]] && echo "-j$_threads" || echo "-j`/usr/bin/getconf _NPROCESSORS_ONLN`") \ From 7bdf7fb3e28fa18a226c5f55cf4fb307669f3ce912668407bbce5093dbbf12eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 17 Jun 2019 09:24:14 +0000 Subject: [PATCH 2/2] Accepting request 710105 from home:StefanBruens:branches:openSUSE:Factory - Take SwapTotal into account, MemTotal only reflects physical memory. Some workers have a considerable amount of swap. OBS-URL: https://build.opensuse.org/request/show/710105 OBS-URL: https://build.opensuse.org/package/show/network:chromium/memory-constraints?expand=0&rev=15 --- memory-constraints.changes | 6 ++++++ memory-constraints.macros | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/memory-constraints.changes b/memory-constraints.changes index 4d8f3bf..48a899c 100644 --- a/memory-constraints.changes +++ b/memory-constraints.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jun 15 14:34:00 UTC 2019 - Stefan BrĂ¼ns + +- Take SwapTotal into account, MemTotal only reflects physical memory. Some + workers have a considerable amount of swap. + ------------------------------------------------------------------- Sat Apr 7 14:57:25 UTC 2018 - tchvatal@suse.com diff --git a/memory-constraints.macros b/memory-constraints.macros index 689a28e..e06c46a 100644 --- a/memory-constraints.macros +++ b/memory-constraints.macros @@ -16,8 +16,9 @@ echo "System jobs: $_threads" \ if test "$_threads" -gt 1 ; then \ mem_per_process="$_core_memory" \ - max_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) \ - max_jobs="$(($max_mem / ($mem_per_process * 1000)))" \ + max_physmem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) \ + max_swapmem=$(awk '/SwapTotal/ { print $2 }' /proc/meminfo) \ + max_jobs="$((($max_physmem + $max_swapmem) / ($mem_per_process * 1000)))" \ test "$_threads" -gt "$max_jobs" && _threads="$max_jobs" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" \ test "$_threads" -le 0 && _threads=1 && echo "Warning: Do not use the parallel build at all because of memory limits" \ fi \