Myeclipse Web工程启动报错
 2015-12-14 10:38:51 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
    at java.lang.StringBuffer.append(StringBuffer.java:224)
    at java.io.StringWriter.write(StringWriter.java:95)
    at java.io.PrintWriter.write(PrintWriter.java:412)
    at java.io.PrintWriter.write(PrintWriter.java:429)
    at java.io.PrintWriter.print(PrintWriter.java:559)
    at java.io.PrintWriter.println(PrintWriter.java:695)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:538)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
2015-12-14 10:38:51 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2015-12-14 10:38:51 org.apache.catalina.core.StandardContext start
严重: Context [/AutoMonitor] startup failed due to previous errors
2015-12-14 10:38:51 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2015-12-14 10:38:53 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
(0 ms) [main] WARN : com.mchange.v2.c3p0.management.ActiveManagementCoordinator#attemptManageC3P0Registry : A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were closed prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources.
(2593 ms) [main] DEBUG: org.apache.struts2.config.PropertiesSettings#debug : struts.properties missing
(2598 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for class com.opensymphony.xwork2.ObjectFactory
(2598 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for class com.opensymphony.xwork2.conversion.impl.XWorkConverter
(2598 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.TextProvider
(2599 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.ActionProxyFactory
(2599 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
(2599 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface org.apache.struts2.dispatcher.mapper.ActionMapper
(2600 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (jakarta) for interface org.apache.struts2.dispatcher.multipart.MultiPartRequest
(2600 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for class org.apache.struts2.views.freemarker.FreemarkerManager
(2617 ms) [main] DEBUG: org.apache.struts2.config.BeanSelectionProvider#debug : Choosing bean (struts) for class org.apache.struts2.views.velocity.VelocityManager to be loaded from the ObjectFactory
(2618 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface org.apache.struts2.components.UrlRenderer
(2618 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.validator.ActionValidatorManager
(2618 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.util.ValueStackFactory
(2619 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionProvider
(2619 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionContextFactory
(2619 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.util.PatternMatcher
(2620 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface org.apache.struts2.dispatcher.StaticContentLoader
(2620 ms) [main] INFO : org.apache.struts2.config.BeanSelectionProvider#info : Choosing bean (struts) for interface com.opensymphony.xwork2.UnknownHandlerManager
(3794 ms) [main] DEBUG: org.apache.struts2.convention.PackageBasedActionConfigBuilder#debug : Processing class [com.auto.number.actions.PhoneNumAction] in package [com.auto.number.actions]
(3817 ms) [main] DEBUG: org.apache.struts2.convention.PackageBasedActionConfigBuilder#debug : Processing class [com.auto.number.actions.UploadExcelDateAction] in package [com.auto.number.actions]
2015-12-14 10:38:59 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-12-14 10:38:59 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2015-12-14 10:38:59 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/42  config=null
2015-12-14 10:38:59 org.apache.catalina.startup.Catalina start
信息: Server startup in 145762 ms

2个回答

集合类中有对对象的引用,使用完后未清空,使得JVM不能回收。
解决方法:手动设置Heap size 修改TOMCAT_HOME/bin/catalina.sh 在“echo "Using CATALINA_BASE: $CATALINA_BASE"”上面加入以下行: JAVA_OPTS="-server -Xms800m -Xmx800m -XX:MaxNewSize=256m"

内存溢出,关闭重启就可以了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐