Home » Questions » Computers [ Ask a new question ]

How do I make compiling code not bring my system to its knees?

How do I make compiling code not bring my system to its knees?

I have a MacBook with Snow Leopard and 2 GB of RAM. When I compile C or C++ code, my system becomes all but unusable. For instance, when I compile LLVM I notice that there are about 10 or 11 processes (cc1plus) getting launched at a time that suck up my CPU time and memory. Is there any way to maybe make it compile less at one time? I'll gladly wait a while longer to have my system usable while I'm compiling.

Asked by: Guest | Views: 86
Total answers/comments: 1
Guest [Entry]

"Use less parallel build jobs. Usually something between CPUs-1 and 2*CPUs-1 is completely sufficient.

Enabling parallel building (like with make -j) does not limit the parallelism at all but by the dependency resolver itself. In case of make add something like make -j3 to build with 3 build jobs in parallel.

Additionally you can deprioritize resource usage by writing nice make -j3 - in case you use make. What build system do you use by the way?"