MyEclipse中项目运行时发生了Tomcat报错:[java.lang.OutOfMemoryError: PermGen space]

时间:2023-02-11 10:05:00

Tomcat内存溢出,异常信息如下:

十一月 26, 2017 1:52:26 下午 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor run
严重: Unexpected death of background thread ContainerBackgroundProcessor[StandardEngine[Catalina]]
java.lang.OutOfMemoryError: PermGen space
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:48)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.reflect.Proxy.newInstance(Proxy.java:764)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:755)
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:300)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:290)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:117)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
at java.lang.reflect.Method.declaredAnnotations(Method.java:714)
at java.lang.reflect.Method.getAnnotation(Method.java:700)
at org.springframework.core.annotation.AnnotationUtils.getAnnotation(AnnotationUtils.java:68)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.findAutowiredAnnotation(AutowiredAnnotationBeanPostProcessor.java:376)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.buildAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:347)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.findAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:318)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:283)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:379)
at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:203)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:183)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:192)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1101)
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395) at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:48)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.reflect.Proxy.newInstance(Proxy.java:764)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:755)
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:300) at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:290)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:117)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
at java.lang.reflect.Method.declaredAnnotations(Method.java:714)
at java.lang.reflect.Method.getAnnotation(Method.java:700)
at org.springframework.core.annotation.AnnotationUtils.getAnnotation(AnnotationUtils.java:68)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.findAutowiredAnnotation(AutowiredAnnotationBeanPostProcessor.java:376) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.buildAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:347)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.findAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:318)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:283)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1120) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:379)
at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:203)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:183)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151) at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:192)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1101)
Exception in thread "default-workqueue-4" java.lang.OutOfMemoryError: PermGen space
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:432)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584) at org.apache.cxf.ws.addressing.VersionTransformer$Names200408.getJAXBContext(VersionTransformer.java:540)
at org.apache.cxf.ws.addressing.VersionTransformer.getExposedJAXBContext(VersionTransformer.java:481)
at org.apache.cxf.ws.addressing.soap.MAPCodec.unmarshalMAPs(MAPCodec.java:489)
at org.apache.cxf.ws.addressing.soap.MAPCodec.decode(MAPCodec.java:675)
at org.apache.cxf.ws.addressing.soap.MAPCodec.mediate(MAPCodec.java:172)
at org.apache.cxf.ws.addressing.soap.MAPCodec.handleMessage(MAPCodec.java:121)
at org.apache.cxf.ws.addressing.soap.MAPCodec.handleMessage(MAPCodec.java:78)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
at java.lang.Thread.run(Thread.java:745)

解决方案:

  利用Notepad++打开该bat脚本文件:D:\MyDev\Tomcat\apache-tomcat-7.0.68\bin\catalina.bat

  在该行:[echo Using CATALINA_BASE:   "%CATALINA_BASE%"]上一行添加一下内容:

REM 解决java.lang.OutOfMemoryError: PermGen space
REM JAVA_OPTS="-server -XX:PermSize=64M -XX:MaxPermSize=128m" REM 解决java.lang.OutOfMemoryError: Java heap space
REM JAVA_OPTS="-server -Xms256M -Xmx512M -XX:MaxNewSize=512m -Djava.awt.headless=true" set JAVA_OPTS="%JAVA_OPTS% -server -XX:PermSize=64M -XX:MaxPermSize=128m -Xms256M -Xmx512M -XX:MaxNewSize=512m -Djava.awt.headless=true"

  如截图所示(可点击图片并右键,于新标签页中打开查看):

MyEclipse中项目运行时发生了Tomcat报错:[java.lang.OutOfMemoryError: PermGen space]

MyEclipse中项目运行时发生了Tomcat报错:[java.lang.OutOfMemoryError: PermGen space]的更多相关文章

  1. Eclipse中启动tomcat报错java.lang.OutOfMemoryError: PermGen space的解决方法

    有的项目引用了太多的jar包,或者反射生成了太多的类,异或有太多的常量池,就有可能会报java.lang.OutOfMemoryError: PermGen space的错误, 我们知道可以通过jvm ...

  2. tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法

    tomcat启动错误提示: 严重: Error waiting for multi-thread deployment of WAR files to completejava.util.concur ...

  3. Tomcat内存溢出(java.lang.OutOfMemoryError: PermGen space)

    Tomcat启动时报如下错误:     java.lang.OutOfMemoryError: PermGen space 解决办法:     配置相关内存大小.其中按照启动tomcat的不同方式,分 ...

  4. Tomcat内存溢出(java.lang.OutOfMemoryError: PermGen space)的解决办法

    Tomcat启动时报如下错误: java.lang.OutOfMemoryError: PermGen space 解决办法: 配置相关内存大小.其中按照启动tomcat的不同方式,分如下三种情况 a ...

  5. jvm 内存溢出 在myeclipse中加大tomcat的jvm内存 java.lang.OutOfMemoryError: PermGen space

    使用myeclipse启动两个SSH2的部署在tomcat6下的项目 报出java.lang.OutOfMemoryError: PermGen space 解决办法: 在myeclipse中加大jv ...

  6. 【转载】java项目中经常碰到的内存溢出问题: java.lang.OutOfMemoryError: PermGen space, 堆内存和非堆内存,写的很好,理解很方便

    Tomcat Xms Xmx PermSize MaxPermSize 区别 及 java.lang.OutOfMemoryError: PermGen space 解决 解决方案 在 catalin ...

  7. 开发部署项目时出现:java.lang.OutOfMemoryError: PermGen space

    java.lang.OutOfMemoryError: PermGen space 错误: 原文地址:http://www.cnblogs.com/shihujiang/archive/2012/06 ...

  8. Eclipse中启动tomcat: java.lang.OutOfMemoryError: PermGen space的解决方法

    tomcat启动的时候出现这种错误一般是项目引用了太多的jar包,或者反射生成了太多的类,或者有太多的常量池,导致非堆内存中永久保存区域不够,就有可能会报java.lang.OutOfMemoryEr ...

  9. 在eclipse中启动项目报java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space

    在我们启动项目的时候经常会出现内存溢出这个错误  设置一下内存就ok 错误信息 java.util.concurrent.ExecutionException: java.lang.OutOfMemo ...

随机推荐

  1. static变量引起的问题,List数据覆盖

    出现的问题:Listt加载数据时,后面加载的数据会覆盖前面的数据,把后面的数据变得和前面一样 原因:因为刚开始把添加的数据写成了静态变量,所以一个改了以后所有都改了 解决方法:把数据设成普通属性,非静 ...

  2. 最大流 Dinic

    struct Dinic { struct node { int x,y,c,next; }line[MAXM]; int Lnum,_next[MAXN],dis[MAXN],dp[MAXN]; b ...

  3. 装黑苹果的那些事儿(以ThinkpadE540为例)

    苹果系统,有着比window更好的安全性和方便性,更重要的事,没有MAC系统环境,进行iOS开发,是很麻烦的,对新手来说,是很懊恼的一件事.但是白苹果像件奢侈品,吾等常人,很难有经济消费.如是黑苹果是 ...

  4. 生成24位字符串ID__IdGenerator.java

    此工具类用于生成24位字符串ID,唯一不重复.直接通过 IdGenerator.get() 获取. 源码如下:(点击下载源码 - IdGenerator.java ) import java.net. ...

  5. WeX5是主要进行app开发吗?能开发微信App吗?

    WeX5是一款html5开发工具,可以进行app开发,做出各种H5 App,同样也可以进行主要运行在PC的html5产品,. WeX5开发的应用,不仅可以在微信上运行,也可以直接手机浏览器运行,或者打 ...

  6. [置顶] c++,vc6.0,中友元函数,无法访问私有字段(private)的问题(problem),cannot access private member declared in class 'Date'

    c++,vc6.0,中友元函数,无法访问私有字段(private)的问题(problem),cannot access private member declared in class 'Date' ...

  7. Configuring Network Configuration-RHEL7

    1.查看网络状态systemctl status NetworkManager You can use the  systemctl status NetworkManager  command to ...

  8. Java Networking: UDP DatagramSocket (翻译)

    原文:http://tutorials.jenkov.com/java-networking/udp-datagram-sockets.html UDP vs. TCP Sending Data vi ...

  9. DWZ使用中遇到的坑

    DWZ官方文档中关于文件上传表单的提交: 因为Ajax不支持enctype="multipart/form-data" 所以用隐藏iframe来处理无刷新表单提交. <for ...

  10. iOS 证书申请新步骤

    2018iOS完整的证书申请和打包过程 - 简书https://www.jianshu.com/p/2b3c2693f4f2