操作系统:linux
服务器:tomcat
问题描述:启动tomcat后,报错内存溢出
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-156"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-128"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-146"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-127"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-125"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-124"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-123"
解决版本:
linux上在tomcat的bin目录catalina.sh文件添加(windows上在tomcat的bin目录catalina.bat文件添加以下配置)
JAVA_OPTS="-server -XX:PermSize=256M -XX:MaxPermSize=1024m"
释义:
-XX:PermSize=256M:初始化类加载内存池大小
-XX:MaxPermSize=1024m:最大类加载内存池大小