Jenkins on Websphere 8.5 - out of memory (heap)

110 views
Skip to first unread message

Tomáš Mrázek

unread,
Sep 19, 2016, 11:15:54 AM9/19/16
to Jenkins Users
So I installed 2.7.4 on Websphere 8.5.5.9.

I'm running job with a maven build. Everything is fine, ear is created, but after that Jenkins stucks and throws Heap error (while creating enviroment variables like JENKINS_HOME).

FATAL: ...
java.lang.OutOfMemoryError: ... Java Heap Error
	at java.lang.String.<init>(String.java:388)
	at java.lang.String.substring(String.java:1372)
	at org.jvnet.winp.WinProcess.parseCmdLineAndEnvVars(WinProcess.java:144)
	at org.jvnet.winp.WinProcess.getEnvironmentVariables(WinProcess.java:121)
	at hudson.util.ProcessTree$Windows$1.getEnvironmentVariables(ProcessTree.java:453)
	at hudson.util.ProcessTree$OSProcess.hasMatchingEnvVars(ProcessTree.java:277)
	at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:479)
	at hudson.Launcher$LocalLauncher.kill(Launcher.java:838)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:540)
	at hudson.model.Run.execute(Run.java:1741)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

So I tried to run simple Groovy script in Jenkins console 

import org.jvnet.winp.Native;
println(Native.parseCmdLineAndEnvVars("jenkins server pid"))

and I got string with 150k chars long, where only first thousand are regular chars with env variables and the rest is some chinese weirdo chars. I tried to run Jenkins with UTF-8 by specifying
-Dclient.encoding.override=UTF-8 which ofc does not help. 

I'm quite hopeless and I don't know, how to fix this. Any suggestions?

Baptiste Mathus

unread,
Sep 19, 2016, 3:03:14 PM9/19/16
to jenkins...@googlegroups.com
What's the Xmx value for that Websphere? Which JDK version, and so on?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/57539fe9-a06a-4bb8-aa89-7c27cd538359%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomáš Mrázek

unread,
Sep 20, 2016, 2:51:46 AM9/20/16
to Jenkins Users, m...@batmat.net
JDK1.8, max heap was set up to 2048M. Implementation for that WinProcess.parseCmdLineAndEnvVars is by creating substrings with one character less and with my baisc calculations, with 150k char String and possibly zero GC I would need 11 gb, That's out of question for such a simple task.There must be something wrong between native method ang getting env variables from WAS.

Dne pondělí 19. září 2016 21:03:14 UTC+2 Baptiste Mathus napsal(a):
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Baptiste Mathus

unread,
Sep 20, 2016, 1:43:34 PM9/20/16
to jenkins...@googlegroups.com

I must be missing something. 150000 characters is not that much in memory. Let's say around 300 kilo bytes actually in the JVM memory in utf 16. So I don't get where those 11GB come from.

Or do you mean 150000 strings of characters of various sizes?

Cheers


To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dec131cd-e46a-4c3b-b0e1-1536e09d91e0%40googlegroups.com.

Tomáš Mrázek

unread,
Sep 21, 2016, 3:49:05 AM9/21/16
to Jenkins Users, m...@batmat.net
300kb is not much, but if you look at the implementation of the called method https://github.com/kohsuke/winp/blob/master/src/main/java/org/jvnet/winp/WinProcess.java ,I got heap exception at line 144. The method creates substrings in loop string lenght > 0. So theoretically after each iteration it stores to RAM another string with one character less.
Reply all
Reply to author
Forward
0 new messages