Search code examples
androidbuildandroid-sourceninja

Limit AOSP build RAM use?


I am trying to build the AOSP 12 and when I reach the soong_build process, ninja maxes out all my RAM and cpu cores. I am using an i7 6700k(8 threads) and 16gb of ram. I have tried make -j1 and other values of -j, but still ninja ignores any of these values, I have tried using ZRam and/or increasing swap size and no luck. When resources max out my pc halts and terminal crashes w/o an error. So is there any way to limit the resources ninja uses ?


Solution

  • So, I upgraded to 32gb of ram and now it works fine.