启动tomcat时报错:Exception in thread "http-bio-8080-exec-42"

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了启动tomcat时报错:Exception in thread "http-bio-8080-exec-42"相关的知识,希望对你有一定的参考价值。

启动tomcat时报一下的错误,而且一直持续不断
Exception in thread "http-bio-8080-exec-2" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-3" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-4" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Timer-0" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-5" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Timer-1" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-6" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-7" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-8" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-9" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-10" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-11" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-13" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-12" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-14" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-15" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-16" java.lang.OutOfMemoryError: PermGen space
求大神指导!

解决方案一:

设置MyEclipse中Tomcat使用的Jdk的VM arguments:

-Xms512m -Xmx1024m -XX:MaxNewSize=512m -XX:MaxPermSize=512m

如图:


解决方法二:  

手动设置MaxPermSize大小
修改TOMCAT_HOME/bin/catalina.bat(Linux下为catalina.sh),在“echo "Using CATALINA_BASE:   $CATALINA_BASE"”上面加入以下行:
set JAVA_OPTS=%JAVA_OPTS% -server -XX:PermSize=128M -XX:MaxPermSize=512m
catalina.sh下为:
JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=128M -XX:MaxPermSize=512m"

参考技术A 内存溢出啊~
解决方法: . 手动设置MaxPermSize大小
修改TOMCAT_HOME/bin/catalina.bat(Linux下为catalina.sh),在“echo "Using CATALINA_BASE: $CATALINA_BASE"”上面加入以下行:
set JAVA_OPTS=%JAVA_OPTS% -server -XX:PermSize=128M -XX:MaxPermSize=512m
catalina.sh下为:
JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=128M -XX:MaxPermSize=512m"追问

我调过内存之后还报这样的错误,不知道还有什么其他方面的原因没?

参考技术B 修改tomcat的启动脚本,加大分配给jvm的内存
windows环境下修改catalina.bat,在开始的地方增加:
set JAVA_OPTS=-Xms512m -Xmx1024m
参考技术C 参考你的服务器配置,然后做如下更改(注意飘红的数字):
Windows:
Modify bin\catalina.bat
Unix:
Modify catalina.sh
Add following scripts below"echo Using CATALINA_BASE: "%CATALINA_BASE%""
rem ----- Execute The Requested Command ---------------------------------------
set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx4096m -XX:CompileThreshold=8000 -XX:PermSize=1024m -XX:MaxPermSize=2048m -Xverify:none -da
echo Using JAVA_OPTS:%JAVA_OPTS%
echo Using CATALINA_BASE: "%CATALINA_BASE%"

以上是关于启动tomcat时报错:Exception in thread "http-bio-8080-exec-42"的主要内容,如果未能解决你的问题,请参考以下文章

用Eclipse的tomcat插件启动tomcat时报错:

项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError

日常Exception第二十五回:Flink启动job时报错,AbstractChannel$AnnotatedConnectException: Connection refused.....

日常Exception第二十五回:Flink启动job时报错,AbstractChannel$AnnotatedConnectException: Connection refused.....

tomcat启动时报错

idea中tomcat启动时报错