Dave Plater píše v Čt 22. 08. 2019 v 12:44 +0200:
On 06/04/2018 15:52, Tomas Chvatal wrote:
Hello all,
For use in libreoffice, chromium and others I've created macro that should allow you to limit jobs based on some constraints you can set later on in the spec to avoid OOM crashes.
The usage is pretty straight forward (Once it is accepted in Tumbleweed):
=== BuildRequires: memory-constraints
%build # require 2GB mem per thread %limit_build -m 2000 make %{?_smp_mflags} ====
Here the _smp_mflags vaule for 8GB machine would be 4 while default is number of cores (lets say 16)...
Both macros %jobs and %_smp_mflags are overriden as such the integration should be really painless if you need to do something like this.
Tom
Somebody used this macro in my graphics/blender package as a replacement for a conditional that I had to decrease the number of build threads. They used -m 800 which appeared to work but intermittent failures due to oom are hard to trouble shoot. The person that had been testing blender git prior to the update to blender 2.80 informed me that there were intermittent oom build failures so I reduced -m to 600 but it's failing more now. I've increased it to 2G -m 2000 because it appears to me that requesting 2G per thread should result in less threads but I wonder why the original user made such a small value in the beginning? Am I right to assume that the higher the -m value the less resulting build threads and the less consumed memory?
The macro works as 'how much memory you need for one core' so having -m 800 means it will be 800MB per core. If you use 2000 it will be 2GB per core and thus limit the threading even more. Tom