dot dot dot
dot dot dot

Reputation: 37

parallel make that is aware of memory

I use "make -j" (along with a makefile) to generate thumbnails and compute various statistics on a large collection of movie files. Depending on the movie, some of the statistics I compute require taking up most of my machine's memory. Is there a way to tell make not to run two such jobs at the same time? Or to kill jobs when memory gets scarce?

Upvotes: 0

Views: 106

Answers (1)

MadScientist
MadScientist

Reputation: 100936

Make does not know how much memory is being used by some other process it invokes. The only way you can do this is to encode it yourself into your makefile, by ensuring (through prerequisites) that make will never run two of these jobs at the same time. You can use order-only prerequisites to ensure ordering without forcing "rebuild if changed" semantics, if these jobs do not have a natural ordering.

Upvotes: 1

Related Questions