Default memory allocation issue in Alfresco CE 201707 GA (aka 5.2)

Document created by angelborroy Moderator on Apr 25, 2018
Version 1Show Document
  • View in full screen mode

Important notice for every Alfresco Community server using default installer

 

If you are using Alfresco 201707 GA and you used default installer (provided by BitRock), your Tomcat is using only 1 GB for your web applications (alfresco.war, share.war & solr4.war).

 

How to check if you are affected

 

When you Alfresco server is up, type following instruction (they can be different depending on your operative system)

 

$ ps -ef | grep java
501 910 1 0 9:39AM ttys001 3:58.00 /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java
-Djava.util.logging.config.file=/opt/alfresco-community/tomcat/conf/logging.properties
-Xms512M -Xmx8192M -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
-Dalfresco.home=/opt/alfresco-community
-XX:ReservedCodeCacheSize=128m -Xms128m -Xmx1024m -XX:+DisableExplicitGC
-Dcatalina.base=/opt/alfresco-community/tomcat
-Dcatalina.home=/opt/alfresco-community/tomcat
-Djava.io.tmpdir=/opt/alfresco-community/tomcat/temp
org.apache.catalina.startup.Bootstrap start

 

Probably you (or the installer) included a Java Memory configuration in the file /opt/alfresco-community/tomcat/bin/setenv.sh (8192M in this sample) but BitRock created a file at /opt/alfresco-community/tomcat/scripts/ctl.sh that is overwriting your configuration to 1024m. This is why two different Xmx and also Xms flags are shown by the ps command. 

 

How to solve the issue

 

In order to allow standard Java Memory configuration to be applied from setenv.sh file, script generated by installer have to be modified. Edit /opt/alfresco-community/tomcat/scripts/ctl.sh to replace this line...

export JAVA_OPTS="-Xms128m -Xmx1024m -XX:+DisableExplicitGC -Djava.awt.headless=true -Dalfresco.home=/opt/alfresco-community -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true -XX:ReservedCodeCacheSize=128m"

... with following content

export JAVA_OPTS="-Djava.awt.headless=true -Dalfresco.home=/opt/alfresco-community -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true -XX:ReservedCodeCacheSize=128m"

Re-start Alfresco and you'll see only one Xmx and Xms flag associated to your Java process Id.

$ ps -ef | grep java
501 910 1 0 9:39AM ttys001 3:58.00 /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java
-Djava.util.logging.config.file=/opt/alfresco-community/tomcat/conf/logging.properties
-Xms512M -Xmx8192M -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
-Dalfresco.home=/opt/alfresco-community
-Dcatalina.base=/opt/alfresco-community/tomcat
-Dcatalina.home=/opt/alfresco-community/tomcat
-Djava.io.tmpdir=/opt/alfresco-community/tomcat/temp
org.apache.catalina.startup.Bootstrap start

 

Final recap

This issue was introduced by BitRock installer and it's not intended to limit Alfresco Community resources.

Alfresco will not patch it, as installer has been discontinued for Alfresco 6.0. 

2 people found this helpful

Attachments

    Outcomes