forked from pool/memory-constraints
Accepting request 710310 from network:chromium
OBS-URL: https://build.opensuse.org/request/show/710310 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/memory-constraints?expand=0&rev=2
This commit is contained in:
commit
4f83f356ef
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Jun 15 14:34:00 UTC 2019 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
||||
|
||||
- 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
|
||||
|
||||
|
@ -16,10 +16,11 @@
|
||||
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" \
|
||||
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`") \
|
||||
|
Loading…
Reference in New Issue
Block a user