[JIRA] (JENKINS-37213) java.lang.OutOfMemoryError: Compressed class space in Job DSL

89 views
Skip to first unread message

paulddraper@gmail.com (JIRA)

unread,
Aug 5, 2016, 9:51:04 AM8/5/16
to jenkinsc...@googlegroups.com
Paul Draper created an issue
 
Jenkins / Bug JENKINS-37213
java.lang.OutOfMemoryError: Compressed class space in Job DSL
Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 2016/Aug/05 1:50 PM
Priority: Minor Minor
Reporter: Paul Draper
# using OpenJDK Java 8
/usr/bin/java -Xms1024m -Xmx3072m -Dorg.apache.commons.jelly.tags.fmt.timeZone=US/Mountain -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/war --httpListenAddress=127.0.0.1 --httpPort=8080 --ajp13Port=-1

After a long time, I encountered the error

FATAL: Compressed class space
java.lang.OutOfMemoryError: Compressed class space
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.define(ClassLoaderForClassArtifacts.java:44)
    at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:77)
    at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:75)
    at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePogoMethod(CallSiteGenerator.java:222)
    at org.codehaus.groovy.reflection.CachedMethod.createPogoMetaMethodSite(CachedMethod.java:233)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createCachedMethodSite(PogoMetaMethodSite.java:150)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createPogoMetaMethodSite(PogoMetaMethodSite.java:126)
    at groovy.lang.MetaClassImpl.createPogoCallSite(MetaClassImpl.java:3405)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPogoSite(CallSiteArray.java:150)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:164)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
    at javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.archiveJunit(PublisherContext.groovy:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
    at javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.archiveJunit(PublisherContext.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

paulddraper@gmail.com (JIRA)

unread,
Aug 5, 2016, 9:52:01 AM8/5/16
to jenkinsc...@googlegroups.com
Paul Draper updated an issue
Change By: Paul Draper
{code}

# using OpenJDK Java 8
# and Jenkins 2.7.1
/usr/bin/java -Xms1024m -Xmx3072m -Dorg.apache.commons.jelly.tags.fmt.timeZone=US/Mountain -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/war --httpListenAddress=127.0.0.1 --httpPort=8080 --ajp13Port=-1
{code}


After a long time, I encountered the error

{code}
{code}

mail@daniel-spilker.com (JIRA)

unread,
Aug 9, 2016, 4:53:02 PM8/9/16
to jenkinsc...@googlegroups.com
Daniel Spilker commented on Bug JENKINS-37213
 
Re: java.lang.OutOfMemoryError: Compressed class space in Job DSL

Is this reproducible? Can you analyze the heap to see what's consuming memory?

paulddraper@gmail.com (JIRA)

unread,
Aug 25, 2016, 11:56:01 AM8/25/16
to jenkinsc...@googlegroups.com

Yes, apparently. It happens almost once a week for me since upgrading from 1.42 to 1.45.

Next time, I'll get a heap dump and metaspace info.

mcrooney@java.net (JIRA)

unread,
Aug 30, 2016, 5:39:02 PM8/30/16
to jenkinsc...@googlegroups.com
mcrooney commented on Bug JENKINS-37213

We've seen this as well a few times with Job DSL 1.48 and Jenkins 2.7.2. I've got a heap dump (2.6GB), Daniel Spilker, I can give you an S3 link or if it is trivial to analyze myself, let me know what to look for.

mail@daniel-spilker.com (JIRA)

unread,
Aug 31, 2016, 2:51:02 AM8/31/16
to jenkinsc...@googlegroups.com

Paul Draper mcrooney Can you try to set the -Dgroovy.use.classvalue=true system property as suggested in JENKINS-33358 and report the results?

mcrooney@java.net (JIRA)

unread,
Sep 8, 2016, 12:41:03 PM9/8/16
to jenkinsc...@googlegroups.com
mcrooney commented on Bug JENKINS-37213

We had our third outage from this so I've now restarted it with that option, would "java -Dgroovy.use.classvalue=true -jar jenkins.war" be a valid invocation to use this? I'll report back the results

mcrooney@java.net (JIRA)

unread,
Sep 8, 2016, 12:47:06 PM9/8/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on Bug JENKINS-37213
We had our third outage from this so I've now restarted it with that option, would "java -Dgroovy.use.classvalue=true -jar jenkins.war" be a valid invocation to use this? I'll report back the results :) However, should this matter in Java 8 (Hotspot) where PermGen is gone? https://www.infoq.com/articles/Java-PERMGEN-Removed

paulddraper@gmail.com (JIRA)

unread,
Sep 9, 2016, 1:40:02 PM9/9/16
to jenkinsc...@googlegroups.com

paulddraper@gmail.com (JIRA)

unread,
Sep 9, 2016, 2:13:01 PM9/9/16
to jenkinsc...@googlegroups.com
Paul Draper commented on Bug JENKINS-37213
 
Re: java.lang.OutOfMemoryError: Compressed class space in Job DSL

I attached the gzipped results of

jcmd <pid> GC.class_stats

You'll notice 1 million ..._run_closure... classes.

To give some background for our setup...."mainJobs" is run in parameterized job that run on each branch push. It creates a different folder for each branch, and a triggers a "jobs" job that produces the jobs in that directory. Periodically, folders for deleted branches are removed.

paulddraper@gmail.com (JIRA)

unread,
Sep 9, 2016, 2:15:02 PM9/9/16
to jenkinsc...@googlegroups.com
Paul Draper edited a comment on Bug JENKINS-37213
I attached the gzipped results of

{code}
jcmd <pid> GC.class_stats
{code}


You'll notice 1 million ..._run_closure... classes.

To give some background for our setup...."mainJobs" is run in parameterized job that run on each branch push. It creates a different folder for each branch, and a creates and triggers a "jobs" job in that folder that runs and produces the jobs in that directory. Periodically, folders for deleted branches are removed.

mail@daniel-spilker.com (JIRA)

unread,
Feb 18, 2017, 3:58:01 PM2/18/17
to jenkinsc...@googlegroups.com
Daniel Spilker resolved as Fixed
 

The next Jenkins release will contain Groovy 2.4.8 to fix this problem.

Change By: Daniel Spilker
Status: Open Resolved
Resolution: Fixed

mail@daniel-spilker.com (JIRA)

unread,
Apr 14, 2018, 9:40:04 AM4/14/18
to jenkinsc...@googlegroups.com
Daniel Spilker closed an issue as Fixed
Change By: Daniel Spilker
Status: Resolved Closed
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages