cancel
Showing results for 
Search instead for 
Did you mean: 

OutofMemory PermGen Space

howejr77
Champ in-the-making
Champ in-the-making
Hello,

I downloaded the Enterprise Content Management 2.2 and Web Content Management 2.1 Modules earlier this week and was working through the WCM 2.1 Product Evaluation Guide and the past 2 days have received the below stack traces. It looks similar to issue WCM-795 but I would think I already have that fix in this code?

Has anyone else been experiencing this or have any suggestions?

Thank You
Ryan


avax.faces.FacesException: PermGen space
caused by:
javax.servlet.ServletException: PermGen space
caused by:
java.lang.OutOfMemoryError: PermGen space

Hide Details

javax.faces.FacesException: PermGen space
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:613)
Caused by: javax.servlet.ServletException: PermGen space
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
12 REPLIES 12

samuel_penn
Champ in-the-making
Champ in-the-making
Have you tried changing the -Xss flag in your JAVA_OPTS? e.g.:

JAVA_OPTS=-Xms512m -Xmx1024m -Xss256k -server‍‍‍

It will be found in the alfresco.bat or (I think) alfresco.sh. The default value is often too small and needs to be increased.

steve
Champ in-the-making
Champ in-the-making
Yes.

Search the forum.
Note, the -Xss flag won't resolve this.

Steve

howejr77
Champ in-the-making
Champ in-the-making
I did see that about increasing the size of the PermGen space but was asking a deeper level of is this still a problem and does some kind of issue need to be created? Doesn't increasing the size of the space just give you more memory (and thus more time) until the problem happens?

pmonks
Star Contributor
Star Contributor
This isn't an issue per se - Alfresco simply loads more classes and has more "long lived" objects (such as Spring beans) than can be stored in the default PermGen region (the default size for this region being 64MB on Sun JVMs).  This is not at all unusual for an application of Alfresco's size.

In fact in my experience the default size is usually enough for a vanilla Alfresco installation, but it comes close enough to the limit that adding additional classes / objects to the same Tomcat instance (and hence the same JVM) is usually enough to overflow the default PermGen size.

Cheers,
Peter

rdanner
Champ in-the-making
Champ in-the-making
To set the size of the perm generation pool use -XXSmiley TongueermSize=128m as a server option.
In tomcat add this to JAVA_OPTS

johanpi
Champ in-the-making
Champ in-the-making
I still get the error.
Any help?

My System Properties
   
Property   Value
alfresco.jmx.dir   /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco
catalina.base   /opt/alfresco/tomcat
catalina.home   /opt/alfresco/tomcat
catalina.useNaming   true
common.loader   ${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar
file.encoding   UTF-8
file.encoding.pkg   sun.io
file.separator   /
heap.free   829.808MB (870117080 bytes)
heap.maxsize   1012.625MB (1061814272 bytes)
heap.size   1012.625MB (1061814272 bytes)
java.awt.graphicsenv   sun.awt.X11GraphicsEnvironment
java.awt.printerjob   sun.print.PSPrinterJob
java.class.path   :/opt/alfresco/tomcat/bin/bootstrap.jar:/opt/alfresco/tomcat/bin/commons-logging-api.jar
java.class.version   49.0
java.endorsed.dirs   /opt/alfresco/tomcat/common/endorsed
java.ext.dirs   /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/ext
java.home   /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre
java.io.tmpdir   /opt/alfresco/tomcat/temp
java.library.path   /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/server:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/../lib/i386
java.naming.factory.initial   org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs   org.apache.naming
java.runtime.name   Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version   1.5.0_13-b05
java.specification.name   Java Platform API Specification
java.specification.vendor   Sun Microsystems Inc.
java.specification.version   1.5
java.util.logging.config.file   /opt/alfresco/tomcat/conf/logging.properties
java.util.logging.manager   org.apache.juli.ClassLoaderLogManager
java.vendor   Sun Microsystems Inc.
java.vendor.url   http://java.sun.com/
java.vendor.url.bug   http://java.sun.com/cgi-bin/bugreport.cgi
java.version   1.5.0_13
java.vm.info   mixed mode
java.vm.name   Java HotSpot(TM) Server VM
java.vm.specification.name   Java Virtual Machine Specification
java.vm.specification.vendor   Sun Microsystems Inc.
java.vm.specification.version   1.0
java.vm.vendor   Sun Microsystems Inc.
java.vm.version   1.5.0_13-b05
javax.net.ssl.trustStore   /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/security/cacerts
javax.net.ssl.trustStorePassword   changeit
javax.security.auth.useSubjectCredentialsOnly   false
line.separator   
org.apache.lucene.lockDir   /opt/alfresco/alf_data/locks
os.arch   i386
os.name   Linux
os.version   2.6.22-14-server
package.access   sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
package.definition   sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
path.separator   :
server.loader   ${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar
shared.loader   ${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
sun.arch.data.model   32
sun.boot.class.path   /opt/alfresco/tomcat/common/endorsed/xalan.jar:/opt/alfresco/tomcat/common/endorsed/serializer.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/rt.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i18n.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/jsse.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/jce.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/charsets.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/classes
sun.boot.library.path   /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386
sun.cpu.endian   little
sun.cpu.isalist   
sun.io.unicode.encoding   UnicodeLittle
sun.java.launcher   SUN_STANDARD
sun.jnu.encoding   UTF-8
sun.management.compiler   HotSpot Server Compiler

pmonks
Star Contributor
Star Contributor
Can you post the value of the JAVA_OPTS JVM parameter in the Tomcat startup script?  The system properties don't really help in this case.

Cheers,
Peter

loftux
Star Contributor
Star Contributor
I had this problem on my ubuntu laptop, using
export JAVA_OPTS='-Xms128m -Xmx1000m -server -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled'‍
helped. Found them after some googling.

NOTE: I've not looked into what these options actually does, so before you do that, do not put them in a production environment.
Maybe someone else can shed some light on them.

//Peter Löfgren

pmonks
Star Contributor
Star Contributor
Setting the PermGen to greater than 128MB is overkill in almost all cases.  Unless you've got RAM to burn (and a JVM that can manage large heaps effectively) I wouldn't suggest going beyond 128MB unless you have a compelling reason to do so.

Cheers,
Peter
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.