File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Caused by: java.lang.OutOfMemoryError: PermGen space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Caused by: java.lang.OutOfMemoryError: PermGen space" Watch "Caused by: java.lang.OutOfMemoryError: PermGen space" New topic

Caused by: java.lang.OutOfMemoryError: PermGen space

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Caused by: java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(
at org.apache.catalina.loader.WebappClassLoader.findClass(
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(
at org.apache.struts2.dispatcher.Dispatcher.init(
at org.apache.struts2.dispatcher.FilterDispatcher.init(
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(
at org.apache.catalina.core.ApplicationFilterConfig.<init>(
at org.apache.catalina.core.StandardContext.filterStart(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.addChildInternal(
at org.apache.catalina.core.ContainerBase.addChild(
at org.apache.catalina.core.StandardHost.addChild(
at org.apache.catalina.startup.HostConfig.deployDescriptor(
at org.apache.catalina.startup.HostConfig.deployApps(
at org.apache.catalina.startup.HostConfig.check(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(

Is the above error a memory leak? How does one counter it?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
David Newton

Joined: Sep 29, 2008
Posts: 12617

Haven't seen that one before--can you provide more details?
Joe Ess

Joined: Oct 29, 2001
Posts: 9191

Presumably, since you're posting this in the Struts forum, you received this error after redeploying your Struts application several times. Unfortunately, this is a common problem due to the way Struts and its dependencies get loaded see here.
You can mitigate the problem by increasing your PermGen space (see the FAQ above), but that will only increase the number of times between OOME's.
I've seen people claiming JRockit does not suffer from this problem because it uses a different memory management system. I can't verify that claim.

[How To Ask Questions On JavaRanch]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

Joe Ess wrote:Unfortunately, this is a common problem due to the way Struts and its dependencies get loaded see here.

hmm, interesting, thanks for the information, Joe.
I agree. Here's the link:
subject: Caused by: java.lang.OutOfMemoryError: PermGen space
It's not a secret anymore!