Description
What is the problem this feature will solve?
My build machine is 8 cores / 16 threads. It has 16GB RAM. If I build with make -j 16
the compile stage takes about 30 min. But during link 5 executables are being linked simultaneously, each taking 4GB RAM. Disk thrashing starts and the link phase takes an extreme long time to complete. In the mean while keyboard/mouse stop responding.
Alternative I can set make -j 2
in which case the compile phase takes multiple hours.
I would like only one executable linked at a time, but compiling to respect 16 threads.
What is the feature you are proposing to solve the problem?
Possibly a hard coded limit in the makefile. Or a command line switch.
What alternatives have you considered?
Other then buying more RAM, I can send SIGSTOP from over ssh (seems to respond better then local terminal). The stopped linkers are swapped out and not swapped back in. Then I can SIGCONT one by one. This works but requires manual intervention.