Facing problem of “java.lang.OutOfMemoryError: PermGen space” in Jenkins

2,865 views
Skip to first unread message

jhooms...@netscape.net

unread,
Mar 1, 2012, 2:09:19 AM3/1/12
to jenkins...@googlegroups.com
Hi All,
I am facing problem of “java.lang.OutOfMemoryError: PermGen space” in Jenkins V1.451, this out of memory issue comes when Jenkins try to connect to Slave or a build starts on Slave, following is the error message:
//----------------------------------------------------------------------------------------------------------------
Exception in thread "RequestHandlerThread[#0]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#5]" java.lang.OutOfMemoryError: PermGen space
Feb 29, 2012 7:46:39 AM hudson.remoting.Channel$ReaderThread run
SEVERE: Unexpected error in channel vw-aus-atm-bl01
java.lang.OutOfMemoryError: PermGen space
        at sun.misc.Unsafe.defineClass(Native Method)
        at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
        at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
        at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95)
        at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313)
        at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1327)
        at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:52)
        at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:437)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
        at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
        at hudson.remoting.Channel$ReaderThread.run(Channel.java:1127)
Exception in thread "Channel reader thread: vl-aus-atm-bl01" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Ping thread for channel hudson.remoting.Channel@87ca1a9:vw-aus-atm-bl01" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Ping thread for channel hudson.remoting.Channel@453130df:vl-aus-atm-bl01" java.lang.OutOfMemoryError: PermGen space
Feb 29, 2012 7:48:18 AM winstone.Logger logInternal
WARNING: Untrapped Error in Servlet
java.lang.OutOfMemoryError: PermGen space
Exception in thread "Channel reader thread: vw-aus-atm-bl01" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#3]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#1]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#4]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#6]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#2]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Jenkins cron thread" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#7]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#8]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#14]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#13]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#9]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#11]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#10]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#12]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#15]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#17]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#16]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#18]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#19]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#21]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#22]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#20]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#23]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#24]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#25]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#26]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#28]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#29]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#27]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "SocketListener(engrhes50x64-rba.local.)" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(engrhes50x64-rba.local.).Timer" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#30]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#31]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#32]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "RequestHandlerThread[#33]" java.lang.OutOfMemoryError: PermGen space
//----------------------------------------------------------------------------------------------------------------
Because of out of memory issue every day I need to restart Jenkins server to make it up, this has became really a pain in neck, anyone has any idea on how I can go away with this issue any configuration  I need to change under my Slave m/c
Slave Lunch Method is “Launch Slave via execution of command on Master”.
 
Any help in this regard is highly appreciated.
 
Thanks,
Jhoom

dhanesh.koliyat

unread,
Mar 1, 2012, 2:13:05 AM3/1/12
to jenkins...@googlegroups.com

To start a new topic under Jenkins users, email ml-node+[hidden email]
To unsubscribe from Jenkins users, click here.
NAML

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com



View this message in context: RE: Facing problem of “java.lang.OutOfMemoryError: PermGen space” in Jenkins
Sent from the Jenkins users mailing list archive at Nabble.com.

Didier Durand

unread,
Mar 1, 2012, 2:14:58 AM3/1/12
to Jenkins Users
Hi,

Did you try to increase the PermGen space in the launch shell script
of jenkins.

If you are like me on Ubuntu it's in /etc/default in file jenkins :
line JAVA_ARGS.

regards

didier

jhooms...@netscape.net

unread,
Mar 1, 2012, 2:55:20 AM3/1/12
to jenkins...@googlegroups.com
I have this entry in my lunch script:
 
export MAVEN_OPTS="-Djava.awt.headless=true -XX:-UseGCOverheadLimit -Xms1280m -Xmx1280m -XX:NewSize=128m -XX:MaxPermSize=512m"



Didier Durand

unread,
Mar 1, 2012, 4:08:21 AM3/1/12
to Jenkins Users
This is for maven: so it will apply to your job after it starts
building (in a separate JVM launched by Jenkins for each Job)

In your case, it is the "master" JVM used by Jenkins core functions
that has the issue: it's definitely the Jenkins launch script that has
to be updated.

Can you tell us about your environnment: os, etc. so that we can
help ?

regards

didier

On Mar 1, 8:55 am, jhoomshar...@netscape.net wrote:
> I have this entry in my lunch script:
>
> export MAVEN_OPTS="-Djava.awt.headless=true -XX:-UseGCOverheadLimit -Xms1280m -Xmx1280m -XX:NewSize=128m -XX:MaxPermSize=512m"
>
>
>
>
>
>
>
> -----Original Message-----
> From: Didier Durand <durand.did...@gmail.com>
> To: Jenkins Users <jenkins...@googlegroups.com>
> Sent: Thu, Mar 1, 2012 12:45 pm
> Subject: Re: Facing problem of “java.lang.OutOfMemoryError: PermGen space” in Jenkins
>
> Hi,
> Did you try to increase the PermGen space in the launch shell script
> f jenkins.
> If you are like me on Ubuntu it's in /etc/default in file jenkins :
> ine JAVA_ARGS.
> regards
> didier
> On Mar 1, 8:09 am, jhoomshar...@netscape.net wrote:
>  Hi All,
>  I am facing problem of “java.lang.OutOfMemoryError: PermGen space” in Jenkins
> 1.451, this out of memory issue comes when Jenkins try to connect to Slave or a
> uild starts on Slave, following is the error message:
>  //----------------------------------------------------------------------------------------------------------------
>  Exception in thread "RequestHandlerThread[#0]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#5]" java.lang.OutOfMemoryError:
> ava.lang.OutOfMemoryError: PermGen space
>  Exception in thread "Ping thread for channel hudson.remoting.Channel@87ca1a9:vw-aus-atm-bl01"
> ava.lang.OutOfMemoryError: PermGen space
>  Exception in thread "Ping thread for channel hudson.remoting.Channel@453130df:vl-aus-atm-bl01"
> ava.lang.OutOfMemoryError: PermGen space
>  Feb 29, 2012 7:48:18 AM winstone.Logger logInternal
>  WARNING: Untrapped Error in Servlet
>  java.lang.OutOfMemoryError: PermGen space
>  Exception in thread "Channel reader thread: vw-aus-atm-bl01"
> ava.lang.OutOfMemoryError: PermGen space
>  Exception in thread "RequestHandlerThread[#3]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#1]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#4]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#6]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#2]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "Jenkins cron thread" java.lang.OutOfMemoryError: PermGen
> pace
>  Exception in thread "RequestHandlerThread[#7]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#8]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#14]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#13]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#9]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#11]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#10]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#12]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#15]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#17]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#16]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#18]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#19]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#21]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#22]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#20]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#23]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#24]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#25]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#26]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#28]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#29]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#27]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "SocketListener(engrhes50x64-rba.local.)"
> ava.lang.OutOfMemoryError: PermGen space
>  Exception in thread "JmDNS(engrhes50x64-rba.local.).Timer"
> ava.lang.OutOfMemoryError: PermGen space
>  Exception in thread "RequestHandlerThread[#30]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#31]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#32]" java.lang.OutOfMemoryError:
> ermGen space
>  Exception in thread "RequestHandlerThread[#33]" java.lang.OutOfMemoryError:
> ermGen space
>  //----------------------------------------------------------------------------------------------------------------
>  Because of out of memory issue every day I need to restart Jenkins server to
> ake it up, this has became really a pain in neck, anyone has any idea on how I
> an go away with this issue any configuration  I need to change under my Slave
> /c

jhooms...@netscape.net

unread,
Mar 1, 2012, 4:13:40 AM3/1/12
to jenkins...@googlegroups.com
I am using Linux, and I already configured my builder user ".bashrc" script with
JAVA_OPTS="$JAVA_OPTS -Xmx1024 -XX:MaxPermSize=512m"
 
Do I need to put this JAVA_OPTS in my Jenkins launch script rather than users .bashrc script


Jesse Farinacci

unread,
Mar 1, 2012, 6:00:17 AM3/1/12
to jenkins...@googlegroups.com
Greetings,

On Thu, Mar 1, 2012 at 2:09 AM, <jhooms...@netscape.net> wrote:
> I am facing problem of “java.lang.OutOfMemoryError: PermGen space” in
> Jenkins V1.451, this out of memory issue comes when Jenkins try to connect
> to Slave or a build starts on Slave, following is the error message:

https://wiki.jenkins-ci.org/display/JENKINS/I'm+getting+OutOfMemoryError

-Jesse

--
There are 10 types of people in this world, those
that can read binary and those that can not.

jhooms...@netscape.net

unread,
Mar 2, 2012, 4:17:43 AM3/2/12
to jenkins...@googlegroups.com
Thanks for all replies I updated my Jenkins lunch script like this:
 
export MAVEN_OPTS="-Djava.awt.headless=true -XX:-UseGCOverheadLimit -Xms1280m -Xmx1280m -XX:NewSize=128m -XX:MaxPermSize=512m"
nohup java -Xms1024m -Xmx2048m -XX:MaxPermSize=512M -XX:+UseParallelOldGC -XX:ParallelGCThreads=4 -Djava.awt.headless=true -DHUDSON_HOME=. -jar jenkins.war --httpPort=18080 --ajp13Port=18009 > jenkins.log 2>&1 &
 
Let’s see for how it works, I will update the list with my output.
Reply all
Reply to author
Forward
0 new messages