I am trying to limit the number of cores used for my gradle build. I am trying to setup a build machine that has predictable behavior (i.e., each job is allocated 2 cores and therefore should take x amount of minutes to complete… assuming I have plenty of memory and disk io is not a problem). If I have a couple parallel gradle jobs running, they seem to steal cpu resources from each other and the completion time is variable (one job kicked off at a later stage can stretch the first job considerably).
I was looking at the –max-workers command line arg. At first, this appeared to be what I was looking for since the default value is set to the number of processors on your machine. In practice, however, I set this value to 2 and my cpu was over 300% (on a 4 core box) during a single job run. I am using gradle 2.14.
Is anything like this supported natively in gradle… or perhaps this should be more on the unix scripting side. Thanks.