Large/Incorrect Memory Allocation on Confluence Process

I've setup my Confluence memory allocations as follows:


verified by 

ps -aux | grep java
 /opt/atlassian/confluence/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/confluence/conf/ -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dsynchrony.port=9004 -Dconfluence.context.path= -Datlassian.plugins.startup.options= -Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 -Dsynchrony.enable.xhr.fallback=true -Xms256m -Xmx768m -XX:+UseG1GC -Datlassian.plugins.enable.wait=300 -Djava.awt.headless=true -XX:G1ReservePercent=20 -Xloggc:/opt/atlassian/confluence/logs/gc-2018-01-05_12-35-28.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution -Djava.endorsed.dirs=/opt/atlassian/confluence/endorsed -classpath /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/confluence -Dcatalina.home=/opt/atlassian/confluence org.apache.catalina.startup.Bootstrap start

However, when running, I see two processes which appear to be hogging quite a bit of RAM:

32016 8166 14.7 44.3 22797120 1395344 pts/0 Sl 12:35 7:04 /opt/atlassian/confluence/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/confluenc
32016 8522 2.1 22.1 16810088 696832 pts/0 Sl 12:36 1:00 /opt/atlassian/confluence/jre/bin/java -classpath /opt/atlassian/confluence/temp/2.1.0-release-c

What am I doing wrong? 

1 answer

0 vote

One of them is Confluence, the other is Synchrony, the service needed to support the collaborative editing function.

You've not done anything wrong, but you will need to think about the memory Synchrony needs on top of Confluence (unless you turn it off and use the old editor)

Thanks for the reply!

So, I tried to pare down the memory usage of Synchrony by adding 

CATALINA_OPTS="-Dsynchrony.memory.max=512m ${CATALINA_OPTS}"


Now I see a slight change to my memory usage:

32016 16786 169 49.6 22861176 1560800 pts/1 Sl 14:51 6:32 /opt/atlassian/confluence/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/confluenc
32016 17148 24.4 15.3 10234912 481608 pts/1 Sl 14:53 0:39 /opt/atlassian/confluence/jre/bin/java -classpath /opt/atlassian/confluence/temp/2.1.0-release-c

However, the Confluence process is still taking 1.5GB...


I would have expected the Confluence process to be limited to 768 MB and the Synchrony process limited to 512MB.  Perhaps I'm misunderstanding?

Memory handling in OS's is "fun" (meaning it's not, and after decades in the industry, I still hate the so-called experts who have failed miserably to make it either not matter or at least understandable to the end user)

Could you have a quick look at what the allocations for the processes are?

ps -ef | grep confluence

should return three lines, but whatever the result, just paste the whole lot here

Haha exactly!  Not only that, these days, memory is assumed to be infinite and every problem can be solved by even more RAM...  However, those of us with limited resources ($$) and only a few users should have other options...

Here is the output of ps -ef | grep confluence:


32016 16786 1 2 Jan05 ? 00:21:53 /opt/atlassian/confluence/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/confluence/conf/ -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dsynchrony.memory.max=512m -Dsynchrony.port=9004 -Dconfluence.context.path= -Datlassian.plugins.startup.options= -Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 -Dsynchrony.enable.xhr.fallback=true -Xms256m -Xmx768m -XX:+UseG1GC -Datlassian.plugins.enable.wait=300 -Djava.awt.headless=true -XX:G1ReservePercent=20 -Xloggc:/opt/atlassian/confluence/logs/gc-2018-01-05_14-52-00.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution -Djava.endorsed.dirs=/opt/atlassian/confluence/endorsed -classpath /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/confluence -Dcatalina.home=/opt/atlassian/confluence org.apache.catalina.startup.Bootstrap start
32016 17148 16786 0 Jan05 ? 00:07:10 /opt/atlassian/confluence/jre/bin/java -classpath /opt/atlassian/confluence/temp/2.1.0-release-confluence_6.5-1a01ab2d.jar:/opt/atlassian/confluence/confluence/WEB-INF/lib/mysql-connector-java-5.1.45-bin.jar -Xss2048k -Xmx512m synchrony.core sql


Additionally, I see the options inside

# Optionally configure JVM
JAVA_OPTS="-Xss2048k -Xmx2g"

 Are those settings overwritten by my addition to below?

CATALINA_OPTS="-Dsynchrony.memory.max=512m ${CATALINA_OPTS}"


I'm not sure what is overriding what, but the two lines you've got tell us what you are ending up running, the most important bits being:

Confluence: -Xmx768m 

Synchrony: -Xmx512m

These define the maximum heap size for the processes, and are perfectly healthy values for a small Confluence in my experience, as long as there's some room left for the OS to run as well as other processes.  Confluence, with Synchrony, should consume at most 1.25Gb RAM, leaving .75Gb for the OS on a 2Gb server.  That's consistent with the % memory use values you saw earlier.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

521 views 19 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you