Jenkins remote agent memory, what % of total RAM?

I have three Jenkins controllers, all using the same bare metal remote machine. The remote machine has 132G of RAM, and the remoting.jar java processes occupy 48G, 46G and 39G RAM! As a result, builds regularly run out of memory.

After a few hours of searching and reading, I found in the openshift documentation the following statement:

By default, each further JVM process run in a Jenkins agent container will use up to 25% of the container memory limit for their heap.

Looking at the remoting source code, I can’t find a reference to such limit.

What’s the limit on an unconfigured remoting agent (no java options are used to run the SSH remote agent).

Remoting shouldn’t need anywhere near that, because your machine is so large you should tune your connection settings you should be fine with something like 2% on your setup: -XX:MaxRAMPercentage -

Thanks Tim.

I learned a lot today… I added these JVM Options when starting the agent:

-Xms2g -Xmx2g -XX:+UseG1GC -XX:+DisableExplicitGC -XX:MaxPermSize=512m
1 Like

Unless you’re running java 7 or older you don’t need the max perm gen setting