I want to run build jobs in Jenkins with minimal cpu usage. I've tried this:
- Created the directory "jenkinsJdk".Jenkins is configured to use this dir as JDK "testJdk". A sample job uses "testJdk" for building.
- The directory "jenkinsJdk" contains symlinks (ln -s) to everything in "/usr/lib/jvm/java-6-openjdk-amd64".
The only 2 files without a symlink are "./bin/java" and "./bin/javac". Both are bash scripts that should only wrap java/javac with setting a nice level. So for "./bin/java":
# nice -n 5 'java $@' java '$@'
Effect: The first line didn't work, so I'm trying to just wrap java for now. But what happens is Jenkins creating about 28000 java 'tasks' (seen via htop) until linux stops it (--> "/jenkinsJdk/java/bin/java: Cannot fork").
Invoking the wrapper for other java programs with "./java somePackage.SomeClass" works fine from bash.
My guess it that it has to be something about how Jenkins invokes the java binary, but I've no clue what I'm doing wrong. Any hints?