Samuel Learning

  • 联系
  •  
  • 管理

文章分类(203)

  • 01 ASP/HTML(6)
  • 02 Script/CSS(16)
  • 03 C/C++
  • 04 XML(4)
  • 05 微软编程(26)
  • 06 J2EE(60)
  • 09 Linux(14)
  • 10 Database(27)
  • 11 报表打印
  • 12 打包安装(1)
  • 13 模式重构(2)
  • 14 系统架构
  • 15 敏捷开发(11)
  • 16 案例分析(30)
  • 17 Workflow(1)
  • 18 配置管理(1)
  • 19 项目管理
  • 20 英语(4)

新闻分类(52)

  • CXF学习
  • Hibernate学习(1)
  • iBatis学习(16)
  • Struts1学习(1)
  • Struts2学习(34)

.NET资源

  • adxmenu
  • C# Open Source
  • DNN Directory
  • M2Land
  • Windows Form FAQ
  • 中国DNN
  • 中国DNN联盟

Ajax

  • DoJo
  • GWT
  • JQuery
  • jquery autocomplete
  • jquery flexgrid
  • JQuery Form
  • jquery masked input
  • JQuery UI
  • jquery validation
  • Jquery 图表
  • jquery报表
  • jquery插件集合
  • Qooxdoo
  • Tibco GI
  • YUI
  • YUI-EXT
  • ZeroKode

Java开源

  • ABLE
  • Agile Tao
  • Ajax4JSF
  • Alfresco
  • AppFuse
  • Compiere
  • Equinox
  • Findbugs
  • Geronimo
  • Grails
  • Harmony
  • Hibernate论坛
  • JAG
  • Java开源大全
  • Java视线论坛
  • jBPM工作流
  • JSFTutorials
  • Nereide ERP
  • Ofbiz ERP
  • Opentaps ERP
  • operamasks
  • Petstore
  • Prototype.js
  • RIFE
  • Runa
  • SpringSide
  • Struts Menu
  • Sun Glassfish
  • Trails
  • YUI4JSF
  • 满江红

Mobile

  • Sencha

WEB资源

  • DHTML中心
  • DHTML参考手册
  • DHTML文档
  • EclipsePlugin
  • Firebug
  • GRO Clinux
  • jMaki
  • JSTL文档
  • LoadIcon
  • Openlaszlo
  • Struts Menu 展示
  • Web Test Tools
  • WebCtrs
  • Webdeveloper
  • 中国RIA开发者论坛

Workflow

  • E-Workflow
  • JBPM
  • OpenWFE
  • OSWorkflow
  • WFMC
  • Workflow Research

其他连接

  • confach
  • CPP
  • ejay
  • Giovanni
  • 丹佛
  • 交大e-learning
  • 交大研究生院
  • 可恶的猫
  • 天天@blog
  • 我的相册
  • 阿飞

大牛人

  • 32篇JBPM
  • David.Turing
  • HongSoft@业务集成
  • Joel
  • Koen Aers
  • Martinfowler
  • Raible Matt
  • Raible Wiki
  • Scott W.Ambler
  • Tom Baeyens
  • Uncle Bob
  • 一个世界在等待
  • 子在川上曰
  • 小布老师
  • 小明
  • 差沙
  • 徐昊
  • 江南白衣
  • 汪博士
  • 汪小金
  • 银狐999

开源软件

  • 2Bizbox ERP
  • CompiereCRM&ERP
  • EGW
  • Vtiger CRM
  • webERP

敏捷

  • Canoo
  • Cruisecontrol
  • DBUnit
  • EL4Ant
  • Extreme Programming
  • Fit
  • Fitnesse
  • JFrog
  • Liquibase
  • Maven
  • MockObjects
  • Selenium
  • Squish
  • xpairtise
  • XPlanner
  • XProgramming
  • 敏捷联盟

数据库

  • Oracle 中国
  • Oracle-ERP
  • Oracle在线社区

未归类

  • Aquarius Orm Studio
  • mambo建站系统
  • Oracle产品下载
  • 远程同步管理工具Capivara

经典框架

  • Apache Shale
  • formdef-struts
  • FreeMarker 主页
  • JBoss Seam
  • JSF 中心
  • JSF 入门应用
  • JSF中国
  • MyFaces官方
  • Spring 社区
  • Spring专业网站
  • Spring中文论坛
  • Spring参考手册
  • Spring官方网站
  • strecks-struts
  • Struts1
  • Struts2
  • Struts-layout
  • StrutsWiKi
  • Tapestry WIKI
  • Tapestry 官方
  • Tapestry4开发指南
  • Tapestry中文文档
  • Webwork2文档
  • Wicket

网络教程

  • Laliluna
  • RoseIndia
  • Sang Shin
  • Visualbuilder

著名站点

  • Buildix
  • Dev2Dev
  • IBM dev中国
  • InfoQ
  • ITPub
  • Java Eye
  • Java Research
  • JavaRead
  • JavaWorldTW
  • Matrix
  • PHP100
  • PHPX
  • SpringSideWiKi
  • TheServerSide
  • TWPHP
  • 中国工作流论坛

项目管理

  • 管理人网

最新评论

View Post

Understanding PermGen errors (part1)

Understanding PermGen errors (part1)

The image verification code you entered is incorrect.
Submitted by alessandroribeiro on Sun, 2006-06-04 01:38. Java

“java.lang.OutOfMemoryError: PermGen space ”: have you seen this error before ? If you have never seen it, you haven't probably been involved in creating large java server applications as of lately. Let's understand what this error means.

When you get OutOfMemoryError, it means that (so obvious) your application doesn't have enough memory to go on. But the rest of the message, “PermGen space” means that it's not the common object heap space that it's lacking, but only the memory space for the binary code of classes and methods is lacking.

Let's go deeper into this subject to understand properly what PermGen means. Well, PermGen is an acronym for “Permanent Generation”. The term Generation comes from the concept of “generational collection” and the term “generational collection” refers to an heuristic in the garbage collection mechanism that is used to intelligently identify only the most probable objects for garbage collection. There are 3 kinds of Generations in the VM memory: the young generation, the tenured generation and the permanent generation.

Let's go back to the original “Permanent Generation” term. As I said, it identifies a particular set of objects which are candidate for garbage collection and handled differently by the GC. These kind of objects which belong to the “Permanent Generation” are only the binary codes of all classes and methods. So, the binary code of classes and methods are not stored in the same memory area as the object instances. Now, I think you already understand what this error mean. “java.lang.OutOfMemoryError: PermGen space ” means that the virtual machine ran out of space for loading the binary code of classes and methods.

There are two steps ahead: knowing understanding why this error has happened to your application, learning to monitor the permanent generation size in order to prevent the occurrence of this error; and learning how to increase the permanent generation size.

Why has this error happened ?

The default size for permanent generatoin is 64M. But how come my not so large web application, which totals 2 megabytes of class code, could exceed this limit ? You're probably not counting it correctly. Your web application probably runs inside Jboss, Tomcat or another J2EE server. Add the size of Java SE libraries, the size of Jboss, the size of all libraries used by Jboss internally, the size of all libraries in the WEB-INF/lib directory of you WAR and you will get a large, large binary code area.

Aren't Java classes loaded on demand ? Yes, they are loaded on demand. So, you will probably have to factor that large number by 3 or 4. But there are other factors for the enlargement of the permanent generation area. If you web application has JSP pages, remember that every JSP page is converted into a servlet class file, before being executed. So, you should add that to the previous number. Also, maybe there are other web applications running under Jboss than you own. If you use Hibernate, for each persistent class that you create, Hibernate will dynamically create an enhanced class. If you use RMI or EJB, many kinds of proxy classes will be created and loaded in memory.

Now that you believe that the size of the binary code of classes and methods can exceed 64M, you have probably given up summing the sizes of all classes created and loaded by the VM, Jboss and you application. You'd better off monitoring the use of PermGen area than trying to calculate its size. That leads us to the next step: how can I monitor the increase in PermGen area.

How can I monitor the increase of PermGen area ?

(I'll finish this 2-part series on PermGen errors tomorrow)

posted on 2008-06-04 15:55 MingIsMe 阅读(308) 评论(0)  编辑  收藏

 
Powered by:
BlogJava
Copyright © MingIsMe