导入公司项目的时候出现的问题,在此记录处理方法。

tomcat在启动的时候报错:OutOfMemoryError: PermGen space

PermGen space的全称是Permanent Generation space,是指内存的永久保存区域。这一部分用于存放Class和Meta的信息,Class在被 Load的时候被放入PermGen space区域,它和和存放Instance的Heap区域不同,GC(Garbage Collection)不会在主程序运行期对PermGen space进行清理,所以如果你的APP会LOAD很多CLASS的话,就很可能出现PermGen space错误。这种错误常见在web服务器 对JSP进行pre compile的时候。但目前的hibernate和spring项目中也很容易出现这样的问题。可能是由于这些框架会动态class,而且jvm的gc是不会清理PemGen space的,导致内存溢出。

网上查找了解决方法:大致有一下三种(我是用了第三种才解决的):

第一种:tomcat的内存不足那就加大它。

    

1. 手动设置MaxPermSize大小
      修改TOMCAT_HOME/bin/catalina.bat(Linux下为catalina.sh),在“echo "Using CATALINA_BASE:   $CATALINA_BASE"”上面加入以下行:
 JAVA_OPTS=%JAVA_OPTS% -server -XX:PermSize=128M -XX:MaxPermSize=512m

catalina.sh下为:
JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=128M -XX:MaxPermSize=512m"

第二种:修改myeclipse 安装目录下的myeclipse.ini文件

(这种方法做记录,好像没有什么用的)

第三种:修改myeclipse中的相关参数

依下图:在Run中找到Run Configurations设置

最后再加一种方案:

在 Optional Java VM arguments中设置:

tomcat 内存溢出问题(OutOfMemoryError: PermGen space)的更多相关文章

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

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

  2. Tomcat死机报OutOfMemoryError: PermGen space错误

    最近,用户没怎么使用系统,页面就卡死,访问不了.仔细一看是Tomcat假死,好几次都这样.重启也慢的很,很着急.最后,看了下 conf/logs 里的配置文件,发现是 OutOfMemoryError ...

  3. tomcat服务器java.lang.OutOfMemoryError: PermGen space

    一挂就报内存溢出 下面是TOMCAT日志 JAVA程序是没有报错, Nov 24, 2009 4:07:02 PM org.apache.catalina.core.ApplicationDispat ...

  4. [转]Tomcat启动java.lang.OutOfMemoryError: PermGen space错误解决

    原文地址:http://outofmemory.cn/java/OutOfMemoryError/outofmemoryerror-permgen-space-in-tomcat-with-eclip ...

  5. windows系统bat方式启动tomcat出现java.lang.OutOfmemoryError:PermGen Space 错误

    1.问题情景: 在部署项目时,将两个应用部署到同一个tomcat下,通过startup.bat启动服务时,控制台出现出现java.lang.OutOfmemoryError:PermGen Space ...

  6. Linux下启动tomcat报java.lang.OutOfMemoryError: PermGen space

    一.错误信息 java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke ...

  7. java中程序上线报错: tomcat中java.lang.OutOfMemoryError: PermGen space

    在程序测试没问题之后,上线试运行,在运行的过程中某个功能一点击就报如下错,然后重启服务器就好了,一会又是如此,解决方法如下(亲测) PermGen space的全称是Permanent Generat ...

  8. 项目部署中,tomcat报java.lang.OutOfMemoryError: PermGen space

    原因: PermGen space的全称是Permanent Generation space,是指内存的永久保存区域,这块内存主要是被JVM存放Class和Meta信息的,Class在被Loader ...

  9. Tomcat发生java.lang.OutOfMemoryError: PermGen space的解决方案

    产生该问题的主要原因是JVM永久带空间不足导致的,可以在环境变量CATALINA_OPTS中提高MaxPermSize参数值   set CATALINA_OPTS = -XX:PermSize=12 ...

  10. eclipse启动tomcat出现内存溢出错误 java.lang.OutOfMemoryError: PermGen space

    发布工程后,启动tomcat出现如下内存溢出错误: java.lang.OutOfMemoryError: PermGen space ... java.lang.OutOfMemoryError: ...

随机推荐

  1. print puts p 用法

    print puts p 用法 print "a\n" puts "a" p "a\n" 输出为 a a "a\n" p ...

  2. [Javascript] Deep Search nested tag element in DOM tree

    // For example you want to search for nested ul and ol in a DOM tree branch // Give example <ol&g ...

  3. jQuery学习之开篇

    吐槽 近期比較烦,对于一个前端白痴来说,工作方向突然转向前端这块着实让人蛋疼无比.前段时间简单的学习了下EasyUI,算是对其有一个简单的认知了吧.EasyUI的研究过程中发现,假设没有掌握JS.JQ ...

  4. UVA - 11077 Find the Permutations (置换)

    Sorting is one of the most usedoperations in real life, where Computer Science comes into act. It is ...

  5. A. Music(Codeforces Round #315 (Div. 2) 求最大的容纳量)

    A. Music time limit per test 2 seconds memory limit per test 256 megabytes input standard input outp ...

  6. ios weak和strong的差别

    The difference is that an object will be deallocated as soon as there are no strong pointers to it. ...

  7. A - Red and Black(3.2.1)(搜索)

    A - Red and Black(3.2.1) Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & ...

  8. oc5--方法

    // main.m // 第一个OC类-方法2 #import <Foundation/Foundation.h> // 1.编写类的声明 @interface Iphone : NSOb ...

  9. c16---字符串

    // // main.c // 字符串的基本概念,字符串和字符数组的共用的char[], #include <stdio.h> int main(int argc, const char ...

  10. h5-9 canvas

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...