Memory leak (groovy)

444 views
Skip to first unread message

Сергей Баранов

unread,
Jan 6, 2017, 5:17:58 AM1/6/17
to Jenkins Users
Hi all,

I have a problem with memory leaks on our Jenkins ver. 2.39 (Pipeline groovy plugin ver. 2.23). 
We have a lot of pipeline jobs, jenkins server crushes 1-2 times a week and we can't find the reason.

I'v created the heap dump and I see a lot of arrays without values 

How can I detect the cause of this problem?

Thanks in advance.

Сергей Баранов

unread,
Jan 9, 2017, 8:02:47 AM1/9/17
to Jenkins Users
I'v tried to analyze heap dump as described here https://wiki.jenkins-ci.org/display/JENKINS/I'm+getting+OutOfMemoryError

this     - value: groovy.lang.GroovyClassLoader #45007
 <- delegate     - class: groovy.lang.GroovyClassLoader$InnerLoader, value: groovy.lang.GroovyClassLoader #45007
  <- <classLoader>     - class: Script1, value: groovy.lang.GroovyClassLoader$InnerLoader #45095
   <- klazz     - class: org.codehaus.groovy.reflection.ClassInfo, value: Script1 class Script1
    <- value     - class: org.codehaus.groovy.reflection.GroovyClassValuePreJava7$EntryWithValue, value: org.codehaus.groovy.reflection.ClassInfo #45981
     <- [1]     - class: java.lang.Object[], value: org.codehaus.groovy.reflection.GroovyClassValuePreJava7$EntryWithValue #45980
      <- [7055]     - class: java.lang.Object[], value: java.lang.Object[] #98508
       <- table     - class: org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Segment, value: java.lang.Object[] #79578
        <- [2]     - class: org.codehaus.groovy.util.AbstractConcurrentMapBase$Segment[], value: org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Segment #14
         <- segments     - class: org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Map, value: org.codehaus.groovy.util.AbstractConcurrentMapBase$Segment[] #2
          <- map     - class: org.codehaus.groovy.reflection.GroovyClassValuePreJava7, value: org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Map #1
           <- globalClassValue     - class: org.codehaus.groovy.reflection.ClassInfo, value: org.codehaus.groovy.reflection.GroovyClassValuePreJava7 #1
            <- [3662]     - class: java.lang.Object[], value: org.codehaus.groovy.reflection.ClassInfo class ClassInfo
             <- elementData     - class: java.util.Vector, value: java.lang.Object[] #162921
              <- classes (Java frame)     - class: org.eclipse.jetty.webapp.WebAppClassLoader, value: java.util.Vector #39670


пятница, 6 января 2017 г., 13:17:58 UTC+3 пользователь Сергей Баранов написал:

Sam K

unread,
Jan 10, 2017, 2:01:50 PM1/10/17
to Jenkins Users
Is the 'groovy sandbox' checked for all jobs?  If you've allowed groovy code to be executed outside of the sandbox, its possible one of the pipelines is using a non-white-listed groovy command that is bringing down Jenkins server.  Just talking from my personal experience.  

Сергей Баранов

unread,
Jan 11, 2017, 3:07:09 AM1/11/17
to Jenkins Users
Thanks for your reply. 
I'v checked this, and found that all our workflow jobs uses SCM, as I know, in this mode 'groovy sandbox' enabled with no options.

вторник, 10 января 2017 г., 22:01:50 UTC+3 пользователь Sam K написал:

Daniel Beck

unread,
Jan 15, 2017, 11:44:31 PM1/15/17
to jenkins...@googlegroups.com
Given that there's ClassInfo in there, could this be https://issues.jenkins-ci.org/browse/JENKINS-33358 ?
> --
> 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-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/abb36e42-9867-42fa-ad8d-8ede086b17b9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages