转载:jenkins解决jenkins内存溢出问题

在jenkins master-slave配置中,总是出现内存溢出问题,更换了机器设备仍然跑不起来:
问题如下:

Status Code: 500  
  
Exception: org.apache.commons.jelly.JellyTagException: jar:file:/Users/alibaba/.jenkins/war/WEB-INF/lib/jenkins-core-1.512.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> Java heap space  
Stacktrace:   
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/Users/alibaba/.jenkins/war/WEB-INF/lib/jenkins-core-1.512.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> Java heap space  
    at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:103)  
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)  
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)  
    at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:384)  
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)  
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)  
    at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)  
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)  
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)  
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)  
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)  
    at org.kohsuke.stapler.Stapler.service(Stapler.java:214)  
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)  
    at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)  
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)  
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)  
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)  
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)  
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)  
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)  
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)  
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)  
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)  
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)  
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)  
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)  
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)  
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)  
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)  
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)  
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)  
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)  
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)  
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)  
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)  
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)  
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)  
    at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227)  
    at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)  
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)  
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)  
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)  
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)  
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)  
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)  
    at java.lang.Thread.run(Thread.java:680)  
Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/Users/alibaba/.jenkins/war/WEB-INF/lib/jenkins-core-1.512.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> Java heap space  
    at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:745)  
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:289)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)  
    at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)  
    at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41)  
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)  
    at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38)  
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)  
    at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)  
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)  
    at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)  
    at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)  
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)  
    at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)  
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)  
    at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)  
    at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)  
    at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44)  
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)  
    at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)  
    at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)  
    at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)  
    at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95)  
    ... 60 more  
Caused by: java.lang.OutOfMemoryError: Java heap space  
    at java.lang.String.replace(String.java:2057)  
    at sun.reflect.AccessorGenerator.internalize(AccessorGenerator.java:402)  
    at sun.reflect.AccessorGenerator.getClassName(AccessorGenerator.java:396)  
    at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:286)  
    at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95)  
    at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313)  
    at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1322)  
    at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:50)  
    at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:435)  
    at java.security.AccessController.doPrivileged(Native Method)  
    at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:411)  
    at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:308)  
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:545)  
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)  
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1494)  
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)  
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1494)  
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1748)  
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)  
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)  
    at hudson.console.AnnotatedLargeText.createAnnotator(AnnotatedLargeText.java:131)  
    at hudson.console.AnnotatedLargeText.writeHtmlTo(AnnotatedLargeText.java:157)  
    at hudson.console.AnnotatedLargeText.writeLogTo(AnnotatedLargeText.java:146)  
    at org.kohsuke.stapler.framework.io.LargeText.doProgressText(LargeText.java:262)  
    at hudson.console.AnnotatedLargeText.doProgressiveHtml(AnnotatedLargeText.java:94)  
    at sun.reflect.GeneratedMethodAccessor586.invoke(Unknown Source)  
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
    at java.lang.reflect.Method.invoke(Method.java:597)  
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)  
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)  
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)  
    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)  
Status Code: 500

Exception: org.apache.commons.jelly.JellyTagException: jar:file:/Users/alibaba/.jenkins/war/WEB-INF/lib/jenkins-core-1.512.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> Java heap space
Stacktrace:
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/Users/alibaba/.jenkins/war/WEB-INF/lib/jenkins-core-1.512.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> Java heap space
at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:103)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:384)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)
at org.kohsuke.stapler.Stapler.service(Stapler.java:214)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/Users/alibaba/.jenkins/war/WEB-INF/lib/jenkins-core-1.512.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> Java heap space
at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:745)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:289)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95)
... 60 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.lang.String.replace(String.java:2057)
at sun.reflect.AccessorGenerator.internalize(AccessorGenerator.java:402)
at sun.reflect.AccessorGenerator.getClassName(AccessorGenerator.java:396)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:286)
at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95)
at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313)
at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1322)
at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:50)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:435)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:411)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:308)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:545)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1494)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1494)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1748)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at hudson.console.AnnotatedLargeText.createAnnotator(AnnotatedLargeText.java:131)
at hudson.console.AnnotatedLargeText.writeHtmlTo(AnnotatedLargeText.java:157)
at hudson.console.AnnotatedLargeText.writeLogTo(AnnotatedLargeText.java:146)
at org.kohsuke.stapler.framework.io.LargeText.doProgressText(LargeText.java:262)
at hudson.console.AnnotatedLargeText.doProgressiveHtml(AnnotatedLargeText.java:94)
at sun.reflect.GeneratedMethodAccessor586.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
问题解决方案:服务器端启动war包添加参数,/usr/bin/java -Xms1024m -Xmx1024m -XX:PermSize=512M -XX:PermSize=1024M -jar jenkins.war --httpPort=18080 --ajp13Port=18009
因为单独在slave机器上跑没有问题,所以slave机器可以不加,如果单独在slave机器上单独运行脚本也有内存溢出问题,那么slave执行脚本也要加
详细文档,参考: http://bbs.scmroad.com/thread-19316-1-1.html

时间: 2024-10-10 11:01:04

转载:jenkins解决jenkins内存溢出问题的相关文章

[转]怎样解决Myeclipse内存溢出?

在用myeclipes10 开发 遇到了 内存溢出问题,百度了很久,这篇比较完善. 总结起来三个方面去检查 1)myeclipes的配置:myeclipes 10 的安装路径下 的myeclipse.ini 2)配置jdk的运行参数,和maven参数差不多 3)配置tomcat的参数 原文链接: 怎样解决Myeclipse内存溢出? 打开myeclipse 10安装目录下的myeclipse.ini文件   打开文件,将文件圈圈中的内容设置如下图:   上面是其中一种解决方案,下面介绍第二种解决

解决JVM内存溢出问题

今天遇到了一个问题,当我在增加配置文件(*.xml)内容的时候,重新启动tomcat6时,控制台报错:java.lang.StackOverflowError: 即,栈溢出错误. 内存溢出,即程序运行要用到的内存大于虚拟机能提供的最大内存就发生内存溢出了. 内存溢出的问题要看业务和系统大小而定. 查看jvm内存 首先我们可以查看jvm内存,在运行里面输入cmd然后输入jconsole,打开Java监视和管理控制台: 选择本地进程连接: 有3种解决JVM内存溢出的方式: 第一种,将没用的配置文件删

linux/centos 解决Tomcat内存溢出

Tomcat本身不能直接在计算机上运行,需要依赖于操作系统和一个JAVA虚拟机.JAVA程序启动时JVM会分配一个初始内存和最大内存给APP.当APP需要的内存超出内存的最大值时虚拟机就会提示内存溢出,并且导致应用服务崩溃. 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space      即JVM Heap溢出 解释说明:JVM在启动的时候会自动设置JVM Heap的值,JVM堆的设置是指java程序运行过程中JVM

大神的---解决tomcat内存溢出问题----tomcat报错:This is very likely to create a memory leak问题解决

tomcat memory leak解决方案 这种问题在开发中经常会碰到的,看看前辈的总结经验 Tomcat内存溢出的原因  在生产环境中tomcat内存设置不好很容易出现内存溢出.造成内存溢出是不一样的,当然处理方式也不一样. 这里根据平时遇到的情况和相关资料进行一个总结.常见的一般会有下面三种情况:  1.OutOfMemoryError: Java heap space  2.OutOfMemoryError: PermGen space  3.OutOfMemoryError: unab

linux下解决Tomcat内存溢出问题

修改catalina.sh文件. 在# OS specific support. $var _must_ be set to either true or false.下,添加以下信息 JAVA_OPTS="-Xms512m -Xmx1024m -Xss1024K -XX:PermSize=128m -XX:MaxPermSize=256m" 大小按实际需要修改.

解决tomacat 内存溢出的问题

在tomcat 点击右键打开open,打开Open launch configuration,在第二个标签页面下面输入 这段代码即可.根据实际配置 -Xms256m -Xmx256m -XX:MaxNewSize=256m -XX:MaxPermSize=256m

jenkins内存溢出的一些解决过程

公司内网测试jenkins服务器,最近总是出现PermGen space(内存溢出)的问题,解决过程记录如下 1.重启jenkins查看日志: 3, 2017 10:54:54 udson.ExtensionFinder$Sezpoz _find WARNING: Failed to load org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelExistsEvent$DescriptorImpl java.lang

【转】Java内存溢出(java.lang.OutOfMemoryError)问题及其解决方法

Java内存溢出(java.lang.OutOfMemoryError)问题及其解决方法 内存溢出有两种情况,如下: 相关配置以Tomcat环境为例 一.java.lang.OutOfMemoryError: PermGen space PermGen space的全称是Permanent Generation space,是指内存的永久保存区域,这块内存主要是被JVM存放Class和Meta信息的. Class在被Loader时就会被放到PermGen space中,它和存放类实例(Insta

Java中OutOfMemoryError(内存溢出)的三种情况及解决办法

相信有一定java开发经验的人或多或少都会遇到OutOfMemoryError的问题,这个问题曾困扰了我很长时间,随着解决各类问题经验的积累以及对问题根源的探索,终于有了一个比较深入的认识. 在解决java内存溢出问题之前,需要对jvm(java虚拟机)的内存管理有一定的认识.jvm管理的内存大致包括三种不同类型的内存区域:Permanent Generation space(永久保存区域).Heap space(堆区域).Java Stacks(Java栈).其中永久保存区域主要存放Class