How do I make make/ninja limit parallelism based on memory pressure?

Not a complete solution – but a potential approach, based on the ‘guard’.

  1. Start make with high ‘-j’ value.

  2. Run a guard job that

    a. Wait for thrashing (page fault/second above a limit), and high CPU utilization.
    b. Find the jobs with the highest memory usage, suspend it.
    c. Wait for some time to allow system to rebalance itself.
    d. Repeat

If the approach looks good, can post sample implementation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)