最近的服务器塞了太多的测试项目,结果连累其他在跑的项目。
异常错误:Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
这个是运行内存不够导致的。
原因分析:
常见的有以下几种:
1.内存中加载的数据量过于庞大,如一次从数据库取出过多数据;
2.集合类中有对对象的引用,使用完后未清空,使得JVM不能回收;
3.代码中存在死循环或循环产生过多重复的对象实体;
4.使用的第三方软件中的BUG;
5.启动参数内存值设定的过小;
常见错误提示:
1.tomcat:java.lang.OutOfMemoryError: PermGen space
2.tomcat:java.lang.OutOfMemoryError: Java heap space
3.tomcat:java.lang.OutOfMemoryError: unable to create new native thread
4.weblogic:Root cause of ServletException java.lang.OutOfMemoryError
5.resin:java.lang.OutOfMemoryError
6.java:java.lang.OutOfMemoryError
分为两种情况:
1、用dos窗口启动tomcat
Windows下,在文件{tomcat_home}/bin/catalina.bat
在文件