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

cancel
Showing results for 
Search instead for 
Did you mean: 

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

angelborroy
Alfresco Employee
2 2 7,903

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. 

About the Author
Angel Borroy is Hyland Developer Evangelist. Over the last 15 years, he has been working as a software architect on Java, BPM, document management and electronic signatures. He has been working with Alfresco during the last years to customize several implementations in large organizations and to provide add-ons to the Community based on Record Management and Electronic Signature. He writes (sometimes) on his personal blog http://angelborroy.wordpress.com. He is (proud) member of the Order of the Bee.
2 Comments