- Use memory-constraints package to limit threads as needed

OBS-URL: https://build.opensuse.org/package/show/network:chromium/memory-constraints?expand=0&rev=9
This commit is contained in:
Tomáš Chvátal 2018-04-06 12:58:25 +00:00 committed by Git OBS Bridge
parent 7d0543f576
commit c2e94693e5

View File

@ -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 becuse 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 $_threads \
%global _smp_mflags -j$_threads \