1

I am getting the following text while running xvfb build config on OKD & which leads to pod termination

exec java -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Xmx0m -cp /home/jenkins/remoting.jar hudson.remoting.jnlp.Main -headless -url http://192.168.247.189:80/ -tunnel 192.168.198.249:50000 09d85a0ed4e8b67a0e8bc448cba7c0e5aea962f34b782dcf22597494e8e0e921 xvfb-mlhmf
Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true
Invalid maximum heap size: -Xmx0m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
couldn't find "-Xmx0m" in either of yaml( buildconfig & Deploymentconfig)

I'm trying to run Jenkins and I am facing an xvfb issue.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Rohit
  • 11
  • 1

1 Answers1

0

I have encountered the same problem when compiling projects in my jenkins instance deployed in OKD after updating it to version 4.12. It is strange because I'm using exactly the same docker images to compile my maven/nodejs projects.

However I have solved it by passing JAVA_MAX_HEAP_PARAM as environment variable to my compilation pods.

To do so, go to "Manage Jenkins" -> "Configure Clouds" -> "Pod Templates" -> "Pod Template Details..." -> "Environment Variable":

enter image description here

If you rather see the changes in xml, this is how it should look like after changes are made:

          <envVars>
            <org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar>
              <key>JAVA_MAX_HEAP_PARAM</key>
              <value>-Xmx512m</value>
            </org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar>
          </envVars>
Fernando Martin
  • 609
  • 6
  • 19