
Hi All! Based on the discussion on IRC and my own research I finally came up with a possible answer to memory depletion while compiling qt6-webengine. I added this to the Pkgfile: export NINJAFLAGS="-j $(( $(awk '/^MemAvailable:/ {print $2}' /proc/meminfo) / 3000000))" It determines the number of threads to use based on qt6-webengine using about 3GB per thread. It uses the memory available value rather than total memory to take into account memory used for desktop, etc. From the discussion on IRC it might be possible build without swapping with 2.5GB per thread but I haven't tested it. Interestingly not all invocations of ninja respect NINJAFLAGS. When building qt6-webengine with the above NINJAFLAGS I see one with -j8 (my machine has 8 threads with about 11GB available) and another with -j 4. I suspect it uses one ninja to parallel other ninja during the most memory intense part of the build there are only two ninja processes. I had been using a shim to compile qt6-webengine but it is cumbersome to use and affected all ninja builds so if I forgot to unshim I got slow builds. This solution might work for machines with widely varied resources but it will cause problems on very small machines. It can cause -j 0 in that case which will be bad since -j 0 means infinity. Probably not a good idea but I suspect a machine that small will not be used to build qt6-webengine anyway. Who has that that much time to wait? Because I use spinning disk for swap it is never a good idea to swap during builds. I've found that limiting the threads to never swap results in a faster compile (clock wise). I've read several complaints about ninja using nproc+2 for the default but the developers refuse to deal with it. I guess somewhere this an unwritten rule that REAL people have at least 4GB per thread. But I respect that, they probably have more than enough to do just to keep up with Qt without trying to get it to compile on every possible machine configuration. -Daryl