Is there a parallel development system that is smart enough to intelligently respond to low memory / replacement conditions?

I am a big fan of speeding up my builds using "make -j8" (replacing 8 with any of my current kernel computer numbers, of course), and compiling N files in parallel is usually very effective at shortening compilation times ... if some of the compilation processes are not intensive enough for memory, because the RAM runs out on the computer, and in this case all the different compilation processes begin to replace each other, and everything slows down to bypass - thus, defeating the target, first perform parallel compilation.

Now, the obvious solution to this problem is to "buy more RAM", but since I'm too cheap for this, it seems to me that it should be able to implement a "make" (or equivalent) that monitors the available RAM of the system, and when RAM becomes almost zero, and the system begins to replace, make automatically turns on and sends SIGSTOP to one or more compilation processes that it spawned. This would completely stop processing stopped processes so that other processes can complete their compilation without further replacement; then, when other processes exit and more RAM becomes available, the make process sends SIGCONT to paused processes, allowing them to resume their own processing. In this way, most exchanges could be avoided, and I could compile all the kernels.

Does anyone know of a program that implements this logic? Or, conversely, is there a good reason why such a program will not / cannot work?

+4
source share
1 answer

For GNU Make, there is the -l option:

  -l [load], --load-average[=load] Specifies that no new jobs (commands) should be started if there are others jobs running and the load average is at least load (a floating- point number). With no argument, removes a previous load limit. 

I do not think there is a standard option for this.

0
source

Source: https://habr.com/ru/post/1347398/


All Articles