"[Multijob] - [ERROR] - Problems occurs on injecting env. vars as a build step: Java heap space", does anyone know, what we can do about it?

20 views
Skip to first unread message

Nico van de Kamp

unread,
Mar 29, 2019, 9:29:35 AM3/29/19
to Jenkins Users
Hello,

I'm added to a colleague who is doing CI/CA for a certain project. I'm "already" three weeks working with jenkins! But without jokes, I'm new to Jenkins.

I see now this error "[Multijob] - [ERROR] - Problems occurs on injecting env. vars as a build step: Java heap space" and I've been searching on the internet but till now, I do not find a solution to resolve this issue? Also the other team members have searching for a solution. I know what the heap means for Java.

What my colleague already have done is:
  • Jenkins.xml: <arguments>Xrs -Xms8192M Xrs -Xmx8192M -Xss64M -XX:MaxPermSize=512M -jar "%BASE%\slave.jar" -jnlpUrl http://....... -secret xxxxxxx</arguments>
  • Searching the internet to find if someone else has also this problem
We use the following versions:
  • Jenkins v2.9, I know there is a newer version (v2.164.x)
  • On this moment I don't know the version number of the env injection plugin. I know the latest version is 2.1.6
  • jre1.8., I believe version 1.8 does not use the MaxPermSize variable anymore or...?
The strange thing is, in the end everything seems to work fine, but I don't like such a messages!

I hope that someone can help us out or point us in a direction that we can solve it!

Thanks in advance,

Nico

Aaron Digulla

unread,
Apr 2, 2019, 4:00:55 AM4/2/19
to Jenkins Users
On Friday, March 29, 2019 at 2:29:35 PM UTC+1, Nico van de Kamp wrote:

I see now this error "[Multijob] - [ERROR] - Problems occurs on injecting env. vars as a build step: Java heap space" and I've been searching on the internet but till now, I do not find a solution to resolve this issue? Also the other team members have searching for a solution. I know what the heap means for Java.

What my colleague already have done is:
  • Jenkins.xml: <arguments>Xrs -Xms8192M Xrs -Xmx8192M -Xss64M -XX:MaxPermSize=512M -jar "%BASE%\slave.jar" -jnlpUrl http://....... -secret xxxxxxx</arguments>

Note: MaxPermSize is unrelated to the problem and not used with Java 8 anymore. In fact, you should see a warning in the logs: https://stackoverflow.com/questions/18339707/permgen-elimination-in-jdk-8

-Xms8192M allocates 8 GB of memory right from the start. This can help with performance. At least, it makes sure that the OS can allocate this much memory before it starts the slave. This eliminates one OOM candidate where you've configured Java for enough memory but the OS simply doesn't have it.

-Xmx8192M should fix your problem unless

1. it's not used. Look at the process table of the slave when the job is running to make sure the option was picked up (it should be but checking is better than believing).
2. you have a huge memory leak. If it always stops at this point, then check the environment variables. Maybe someone was "clever" and tried to put a huge amount of data into an environment variable.

  • Searching the internet to find if someone else has also this problem

This doesn't work because every memory leak is different. You will have to understand your own code, how your configured Jenkins and how everything works.

Use a memory profiler like YourKit or or try to disable things until the error goes away.

Regards,

Aaron Digulla
Reply all
Reply to author
Forward
0 new messages