洗洗就睡了
催眠曲进行中
农妇,山泉,有点田
我的首页
文章
相册
圈子
留言
管理
 
    当前所在页面:首页>>文章>>java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
    作者: 来源:http://yiwong.spaces.live.com/ 发表时间:2008-04-04

 
 

Everyday a surprise, there are no exceptions today.

According to james' s email, system crahsed last night.  I checked tomcat log and found Exception as follows:

in thread “com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0” java.lang.OutOfMemoryError: PermGen space

I have to say, I hate "out of memory". It is really hard to report the situation to Jonny, he think 8G memory is far enough for our application.

After a short time research, I got explanation from internet: The permanent generation is used to hold reflective of the VM itself such as class objects and method objects. These reflective objects are allocated directly into the permanent generation, and it is sized independently from the other generations. Generally, sizing of this generation can be ignored because the default size is adequate. However, programs that load many classes may need a larger permanent generation. This error occurs when the JVM runs out of space in the permanent generation heap. Since the defaults for the JVM are quite low, the first step should be to increase the default using -XX:MaxPermSize.

The final Solution is :  configure MaxPermSize in /etc/profile or /etc/bash.bashrc

the java option will be: JAVA_OPTS=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m

If you do not want to restart server, you can activate configuration by command like

source /etc/bash.bashrc

 

 
 

(阅读 )   评论数(:1)
评论】 【收藏】
评论:共1条
补充一下Windows下的做法:
设置环境变量JAVA_OPTS=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m
即可,java.lang.OutOfMemoryError: PermGen space的问题以前经常遇到,现在可以对付了
评论人: netgod     评论时间: 2008-04-08 20:30:22

发表评论:
发表人:
评论: 
验证码:
请输入前面图中的四位验证码,字母不区分大小写
  
 
关于我们 | 诚聘英才 | 联系我们 | 广告业务 | 网站地图 | 法律声明

EasyJF开源团队版权所有  建议使用1024*768分辨率