cancel
Showing results for 
Search instead for 
Did you mean: 

OutOfMemoryError: Java heap space

hedi_ad
Champ on-the-rise
Champ on-the-rise
Hello,

I have a problem with alfresco community 4.2.f that is installed on windows server 2008 R2.

the problem is that alfresco crashes and I can not access the web interface (tomcat)
so I thought that the problem is due to the configuration PermSize, so I configured as follows this file "C:\Alfresco\tomcat\bin\setenv.bat":

set JAVA_OPTS=++JvmOptions="-XX:-DisableExplicitGC" ++JvmOptions="-XX:ReservedCodeCacheSize=128m" –JvmMs 128 –JvmMx 768 ++JvmOptions=" -Xms2g -Xmx10g -server -XX:MaxPermSize=1g" %JAVA_OPTS%

similarly, I modified the registry "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\alfrescoTomcat\Parameters\Java\option":

-Xms2048M
-Xmx10240M
-Dalfresco.home=C:\Alfresco
-Dcom.sun.management.jmxremote
-Dcatalina.base=C:\Alfresco\tomcat
-Dcatalina.home=C:\Alfresco\tomcat
-Djava.endorsed.dirs=C:\Alfresco\tomcat\endorsed
-Djava.io.tmpdir=C:\Alfresco\tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Alfresco\tomcat\conf\logging.properties
-XX:-DisableExplicitGC
-XX:ReservedCodeCacheSize=128m
-XX:MaxPermSize=512M

but the problem still persists, here is the error that appears in alfresco.log


01:36:06,271 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 09210010 Wrapped Exception (with status template): 09211708 Error during processing of the template 'Java heap space'. Please contact your system administrator.
org.springframework.extensions.webscripts.WebScriptException: 09210010 Wrapped Exception (with status template): 09211708 Error during processing of the template 'Java heap space'. Please contact your system administrator.
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
   at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:422)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:268)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.alfresco.service.cmr.repository.TemplateException: 09211708 Error during processing of the template 'Java heap space'. Please contact your system administrator.
   at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:222)
   at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:896)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   … 31 more
Caused by: java.lang.OutOfMemoryError: Java heap space


any help will be apreciated.

Hedi Adouni,
Open Source Consultant

13 REPLIES 13

angelborroy
Community Manager Community Manager
Community Manager
Have you any customization or addon deployed in your Alfresco?
Hyland Developer Evangelist

there is no addon installed in my alfresco server. However, I use CmisSync for synchronize files

angelborroy
Community Manager Community Manager
Community Manager
Are you using your own Java VM or the one inside Alfresco installer?

You cannot fix this problem increasing Java memory settings, it's related with Java version. Maybe a good approach should be to change your Java VM by another one (for instance: Oracle Java 8).
Hyland Developer Evangelist

Actually, I use JVM inside Alfresco. Can I increase the version of default JVM installed?

angelborroy
Community Manager Community Manager
Community Manager
I think it's easier to install a new JDK and to set JRE_HOME at Tomcat scripts.
Hyland Developer Evangelist

hedi_ad
Champ on-the-rise
Champ on-the-rise
the same problem is raised every morning, I am always forced to restart the whole server … even with incrementing the version of JVM.

hedi_ad
Champ on-the-rise
Champ on-the-rise
any help?

angelborroy
Community Manager Community Manager
Community Manager
Can you include your night logs? There is a number of processes launched periodically. Maybe some of them it's out of control.
Hyland Developer Evangelist

Hello, please find the log file join this comment,
I minimize file size because the error is repeated until the intervention on my part by  reboot the PC or reboot service