JAVA编译异常处理:java.lang.OutOfMemoryError: PermGen space

在Intellij开发工具中编译JAVA项目,出现以下错误:

六月 21, 2016 6:28:07 下午 org.apache.tomcat.util.modeler.BaseModelMBean invoke
严重: Exception invoking method manageApp
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:121)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:440)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
at ch.qos.logback.classic.Logger.log(Logger.java:788)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.warn(SLF4JLocationAwareLog.java:192)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:487)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5229)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5516)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1763)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

六月 21, 2016 6:28:07 下午 org.apache.tomcat.util.modeler.BaseModelMBean invoke
严重: Exception invoking method createStandardContext
javax.management.RuntimeErrorException: Error invoking method manageApp
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:312)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:121)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:440)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
at ch.qos.logback.classic.Logger.log(Logger.java:788)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.warn(SLF4JLocationAwareLog.java:192)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:487)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5229)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5516)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1763)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

Exception in thread "RMI TCP Connection(idle)" [2016-06-21 06:28:08,875] Artifact spfcore_web:war exploded: Error during artifact deployment. See server log for details.
java.lang.OutOfMemoryError: PermGen space
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(Unknown Source)
at sun.reflect.MethodAccessorGenerator$1.run(Unknown Source)
at sun.reflect.MethodAccessorGenerator$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(Unknown Source)
at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(Unknown Source)
at sun.reflect.ReflectionFactory.newConstructorForSerialization(Unknown Source)
at java.io.ObjectStreamClass.getSerializableConstructor(Unknown Source)
at java.io.ObjectStreamClass.access$1500(Unknown Source)
at java.io.ObjectStreamClass$2.run(Unknown Source)
at java.io.ObjectStreamClass$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectStreamClass.<init>(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectStreamClass.<init>(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.OutOfMemoryError: PermGen space
Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: PermGen space
六月 21, 2016 6:29:37 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:38 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:39 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:41 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:42 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:43 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

Exception in thread "org.springframework.scheduling.quartz.SchedulerFactoryBean#0_QuartzSchedulerThread" java.lang.OutOfMemoryError: PermGen space
六月 21, 2016 6:29:45 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:46 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:48 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:49 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:50 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:52 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:53 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:29:54 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

六月 21, 2016 6:30:02 下午 org.jboss.netty.channel.socket.nio.NioWorker
警告: Unexpected exception in the selector loop.
java.lang.OutOfMemoryError: PermGen space

解决方案:

时间: 2024-11-04 03:52:05

JAVA编译异常处理:java.lang.OutOfMemoryError: PermGen space的相关文章

异常处理系列:java.lang.OutOfMemoryError: PermGen space

今天帮同学解决他的Tomcat启动的问题,报出了一个OutOfMemoryError的异常,然后就搜啊搜的,突然发现特别有趣. 先不扯淡了,先说解决办法: 一看到这个就知道是内存满了.所以要把Tomcat的内存池加大一点. 修改如下: 1. window-->Preferences,然后直接在搜索的那个框里边写上"tomcat",会出现如下的界面: 2. 选中你安装的tomcat版本,选中下面的JDK,在右边的 Optional Java VM arguments 文本框中输入:

开发笔记--java.lang.OutOfMemoryError: PermGen space异常处理

第一次到公司开发项目,比起之前的小项目来说这次的项目特别大,以至于运行之后出现了java.lang.OutOfMemoryError: PermGen space的异常,从字面意思上来看是内存溢出的原因,这里引用别人的博客 1.PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决方法也一定是加大内存.说说为什么会内存益出:这一部分用于存放Class和

java.lang.OutOfMemoryError: PermGen space从解决方法中认识堆与非堆

1)堆(Heap)和非堆(Non-heap)内存 按照官方的说法:“Java 虚拟机具有一个堆,堆是运行时数据区域,所有类实例和数组的内存均从此处分配.堆是在 Java 虚拟机启动时创建的.”“在JVM中堆之外的内存称为非堆内存(Non-heap memory)”. 可以看出JVM主要管理两种类型的内存:堆和非堆.简单来说堆就是Java代码可及的内存,是留给开发人员使用的:非堆就是JVM留给自己用的, 所以方法区.JVM内部处理或优化所需的内存(如JIT编译后的代码缓存).每个类结构(如运行时常

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

解决方案 在 catalina.bat 里的 蓝色代码前加入: 红色代码 rem ----- Execute The Requested Command --------------------------------------- set JAVA_OPTS=%JAVA_OPTS%-server -Xms800m -Xmx1024m  -XX:PermSize=128m -XX:MaxPermSize=256m echo Using CATALINA_BASE: "%CATALINA_BASE

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

Tomcat Xms Xmx PermSize MaxPermSize 区别 及 java.lang.OutOfMemoryError: PermGen space 解决 解决方案 在 catalina.bat 里的 蓝色代码前加入: 红色代码 rem ----- Execute The Requested Command --------------------------------------- set JAVA_OPTS=%JAVA_OPTS%-server -Xms800m -Xmx1

Web项目java.lang.OutOfMemoryError: PermGen space异常解决

接手一个新的Web项目,编译运行(Tomcat版本为7),运行的时候报出了java.lang.OutOfMemoryError: PermGen space的异常,搜了一下这样解释: PermGen space的全称是Permanent Generation space,是指内存的永久保存区域. 为什么会内存溢出,这是由于这块内存主要是被JVM存放Class和Meta信息的,Class在被Load的时候被放入PermGen space区域,它和存放Instance的Heap区域不同,sun的 G

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

使用myeclipse启动部署在tomcat7下的三个项目报出java.lang.OutOfMemoryError: PermGen space 解决办法: 在myeclipse中加大jvm内存方法:Window->Preferences->Myeclipse->Services->Tomcat->Tomcat 6.x->JDK,在Optional Java VM arguments:下边的输入框里输入:-Xms128m -Xmx512m -XX:PermSize=12

Eclipse:java.lang.OutOfMemoryError: PermGen space

先是好端端的上不了网,然后电脑就重启,重启之后,整个项目就报"java.lang.OutOfMemoryError: PermGen space" 网上说了很多方法,什么修改eclipse.ini,修改tomcat bin目录下的catalina.sh文件,但是对我问题没有一点用处, 最后,解决方案如下: 记住一定要换行啊!

tomcat 开启时,或者访问网页后PermGen space错误解决方法 java.lang.OutOfMemoryError: PermGen space

公司以前都是一个项目一个tomcat,为了整合,我把两个项目放到了一个tomcat下,结果打开tomcat后,随便访问几个网页,或者登录一个账号后就会报错,提示 java.lang.OutOfMemoryError: PermGen space 上网搜索后,发现是JVM的默认内存只有4M太小,开启tomcat后要加载所有项目,就会导致JVM的内存溢出. Windows下tomcat修改 .编辑tomcat的catalina.bat文件,在第一行的后面增加一句:set JAVA_OPTS=-ser