java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

 java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

异常名称 : 内存溢出异常
在启动tomcat的时候或者运行过程中抛出以下异常

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-80-exec-31"
1
2
解决方法:
1. 在安装tomcat的bin目录下找到catalina.bat文件,打开编辑
2. 在开头加上以下内容

set JAVA_OPTS= -Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxNewSize=256M -XX:MaxPermSize=256M
1
-Xms1024M:初始化堆内存大小(注意,不加M的话单位是KB)
-Xmx1029M:最大堆内存大小
-XX:PermSize=256M:初始化类加载内存池大小
-XX:MaxPermSize=256M:最大类加载内存池大小

原文地址:https://www.cnblogs.com/dayspring/p/13032262.html