cancel
Showing results for 
Search instead for 
Did you mean: 

Again a PermGen problem

claudio_corsi
Champ in-the-making
Champ in-the-making
Hi all,
I'm trying the Alfresco Lab 3.0 boundle edition (the one with Tomcat included).

I've configured everything correctly following the Wiki, in fact I get no WARNING or ERROR into the log when I start Alfresco.

Anyway, when I try to access for the first time the application via Web Browser (http://localhost:8080/alfresco),  I get an OutOfMemory error due to the PermGen component (both in the logs and in the browser).

The alfresco.log (as the catalina.log) reports the following error (repeated many times):

17:32:04,997 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.OutOfMemoryError: PermGen space
   at org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:207)
   at org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:179)
   at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)
   at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178)
   at org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2166)
   at org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:62)
   at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
   at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
   at org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1107)
   at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:767)
   at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:947)
   at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:266)
   at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:195)
   at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
   at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
   at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:425)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
   at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   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.doInclude(ApplicationDispatcher.java:594)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
   at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965)
   at org.apache.jsp.jsp.dashboards.layouts.single_002dcolumn_jsp._jspService(single_002dcolumn_jsp.java:163)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)

Note that I get this error both launching the Alfresco app via /etc/init.d/alfresco script (copied from the wiki) and using the alfresco.sh script released within the original .tar.gz.

Crawling the forum I've seen that many people has this problem and someone has solved it using some custom JAVA_OPTS parameters. I'm trying to find the right configuration form me, but no way!

So far I'm using:


export JAVA_OPTS='-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -server -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled'

I'm echoing JAVA_OPTS in tomcat/bin/startup.sh to be sure that such value is still there when I run this script. It seems to be ok, as in console I read:

root@pgbserver:/opt/alfresco# ./alfresco.sh start
Using JAVA_OPTS: -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -server -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:CompileCommand=exclude,org/apache/lucene/index/IndexReader$1,doBody -XX:CompileCommand=exclude,org/alfresco/repo/search/impl/lucene/index/IndexInfo$Merger,mergeIndexes -XX:CompileCommand=exclude,org/alfresco/repo/search/impl/lucene/index/IndexInfo$Merger,mergeDeletions
Using CATALINA_BASE:   /opt/alfresco/tomcat
Using CATALINA_HOME:   /opt/alfresco/tomcat
Using CATALINA_TMPDIR: /opt/alfresco/tomcat/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun

To now nothing seems to change even if I use a different config, the PermGen OutOfMem error still come out!

What do you think?
2 REPLIES 2

rdanner
Champ in-the-making
Champ in-the-making
-XX:MaxPermSize=512m

I do not put this parameter in the configuration.  You also want to give Alfesco as much heap space as you can afford to give it. The new bundle ships with Share and Alfresco.  This is two applications rather than one.  Some of the libraries in each of the apps are large as libraries go (Spring for example.)

It's a bummer that this perm gen issue is so absolutely pesky.  Particularly for those who do not use an installer.  There is no good way for Alfresco to set a reasonable default because without an interactive installer because it cannot make assumptions about how much memory you have to allocate to the server.

claudio_corsi
Champ in-the-making
Champ in-the-making
Well,
I've tried many different configurations, but each time I get the OutOfMemory error for PermGen.

The server has 1Gb of RAM. As you can see I'm using -Xmx1024m as max heap size. I've tried to augment the PermGen space up to 1024m, but still I get the OutOfMemory error and nothing seems to change. Moreover on the Web I've read that a value of 128m should be really enough for PermGen (while the default is 64m).

I'm wondering if Alfresco need at least 2 or 3 Gb of RAM! This would be a big constraint, especially if Alfresco is not the only web apps running on the server…

I'll try the installer as you suggest to see if it configures the Alfresco instance with different Java options… In the meanwhile, have you others try to suggest?

Thanks!