当前位置: 代码迷 >> 应用服务器 >> outOfMemory.查找了好多解决方法.没有一个见效
  详细解决方案

outOfMemory.查找了好多解决方法.没有一个见效

热度:1039   发布时间:2013-02-26 00:00:00.0
outOfMemory...查找了好多解决办法.没有一个见效
Eclipse 3.4.1 + Tomcat 6.0.33
别告诉我换工具

catalia.bat
set JAVA_OPTS=-server -Xms512m -Xmx1024m -XX:PermSize=64M -XX:MaxNewSize=512m -XX:MaxPermSize=128m -Djava.awt.headless=true


严重: Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.jfree.chart.JFreeChartInfo.<init>(JFreeChart.java:1741)
at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.java:243)
at org.jfree.chart.ChartFactory.createPieChart3D(ChartFactory.java:494)
at org.apache.jsp.webMain_jsp._jspService(webMain_jsp.java:1565)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2011-9-15 16:47:21 org.apache.catalina.core.StandardWrapperValve invoke

------解决方案--------------------------------------------------------
内存溢出啊,6年前我被这个问题曾经困扰2个月之久,当时是
apacht http server + tomcat + jdk1.3
当时的解决办法是跟踪内存占用对象,检查全部的代码,清理String的使用,全换成StringBuffer了
最终找的问题出现在内容管理系统页面模板静态化时反复使用字符串连接导致的。
  相关解决方案