Instead of passing mem and slaveJarMem which is a bit confusing how about passing around a "Resources" object. The object could contain numExecutors, slaveCpus, slaveMem, execuorCpus and executorMem. Inside JenkinsScheduler.java the "Resources" object could be handled appropriately? You could do that in a subsequent review if you don't want to do it now.