我的程序一开始报java.lang.OutOfMemoryError: PermGen space异常,后来在网上查了一下资料,然后根据http://hi.baidu.com/tiger560/blog/item/498e72893ab69cb70e24444b.html上说的对tomcat进行了修改,修改后启动正常,但是在tomcat启动时修改程序源文件,保存后发现问题还没有彻底解决,控制台信息如下:
Setting DefaultObjectTypeDeterminer as default ...
- Filter initialized. Response buffering is enabled
- DWR Version 2.0.5 starting.
- - Servlet Engine: Apache Tomcat/6.0.16
- - Java Version: 1.5.0_14
- - Java Vendor: Sun Microsystems Inc.
- Clash of converters for com.berchina.vo.RuleAuthority. Using org.directwebremoting.convert.BeanConverter in place of org.directwebremoting.convert.BeanConverter
- Clash of converters for com.berchina.vo.CheckDateForUpdate. Using org.directwebremoting.convert.BeanConverter in place of org.directwebremoting.convert.BeanConverter
到这的时候就不在往下运行了,我打开一个页面想登陆这个系统,点击登陆后,控制台又输出异常信息:
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8080-2" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Timer-1" java.lang.OutOfMemoryError: PermGen space
内存溢出。
如果你的应用中有很多CLASS的话,就很可能出现PermGen space错误,
这种错误常见在web服务器对JSP进行pre compile的时候。如果你的WEB APP下使用了大量的第三方jar, 其大小超过了jvm默认的大小(4M)
那么就会产生此错误信息了。
解决方法: 手动设置MaxPermSize大小
修改TOMCAT_HOME/bin/catalina.sh
在“echo "Using CATALINA_BASE: $CATALINA_BASE"”上面加入以下行:
JAVA_OPTS="-server -XX:PermSize=64M -XX:MaxPermSize=128m
建议:将相同的第三方jar文件移置到tomcat/shared/lib目录下,这样可以达到减少jar 文档重复占用内存的目的。
分享到:
相关推荐
### Java.lang.OutOfMemoryError: PermGen space 及其解决方法 #### 一、PermGen space 概述 在Java虚拟机(JVM)中,PermGen space(永久代)是用于存储类的信息、常量、静态变量等数据的区域。在Java 8之前,Perm...
在Java应用程序运行过程中,"java.lang.OutOfMemoryError: PermGen space"错误是常见的一个问题,尤其是在使用Tomcat这样的Java应用服务器时。这个错误表明应用程序在 PermGen 区域(Permanent Generation)耗尽了...
java.lang.OutOfMemoryError: PermGen space 解决方案
4. **调整PermGen空间**:在Java 8之前, PermGen 区域用于存储类的元数据,如果这个区域耗尽,会出现`java.lang.OutOfMemoryError: PermGen space`错误。在Java 8中,这部分被MetaSpace取代,可通过`-XX:...
Java中的`java.lang.OutOfMemoryError`是一个严重的问题,它表示Java虚拟机(JVM)在尝试分配新的对象时没有足够的内存。这个错误通常会导致应用程序崩溃。本文将深入探讨这种错误的原因、常见类型以及解决策略。 *...
tomcat内存溢出解决办法,错误信息:java.lang.OutOfMemoryError:PermGen space 参考该文档可快速解决内存溢出的问题,服务器:tomcat
- **解决方法**:Java 8之后,PermGen被Metaspace取代,处理方式类似。可以增加 Metaspace 的大小(`-XX:MaxMetaspaceSize`),或者限制加载的类数量,避免频繁加载新类。 在针对`OutofMemoryError`进行故障排查时...
Eclipse 中通过 Tomcat 运行 J2EE 项目 java.lang.OutOfMemoryError PermGen space 的解决方案 在 Eclipse 中通过 Tomcat 运行 J2EE 项目时,可能会出现 java.lang.OutOfMemoryError: PermGen space 异常,这是由于...