How to Increase Synchrony Heap Allocation
This guide only applies to managed Synchrony mode. For standalone deployments, the heap size needs to be adjusted on the start-synchrony.sh
script by directly setting the Xmx value under the Optionally configure JVM section.
Purpose:
Collaborative Editing is a feature that allows multiple people to concurrently edit a single Confluence page or blog post. This feature runs on an engine called Synchrony, which spawns a separated JVM Process than the one Confluence runs with in order to handle its operations. Synchrony has its own Heap Allocation and System Arguments and sometimes, we may need to increase Synchrony Heap Allocation based on the amount of users running the engine at the same time.
Solution:
In order to have the changes applied here taking effect, we will need to restart our Confluence instance.
- Stop Confluence.
- To do that, open up a terminal window and browse your way to the
Confluence-Installation-Directory/bin
folder. - Inside this very same folder, run the following command:
./stop-confluence.sh
- Just consult with your team first to understand if this is the script usually used or if you have customized a different one based upon your needs. If this is the case, run the customized one.
- To do that, open up a terminal window and browse your way to the
- Now that we stopped Confluence, under the same
Confluence-Installation-Directory/bin
folder, look for a file calledsetenv.sh
.- Open this file.
- Search for
synchrony.memory.max
. If you have this setup, just change its value to an appropriate allocation. If you don't have this setup, it means that the default Heap Allocation for Synchrony was applied, which, in this case, is 2GB for versions above 7.10 and 1GB for versions below it. We need to add the parameter to change the Heap Allocation. The example below sets it to 2GB, change the number to allocate as many GB's as you may need to.
CATALINA_OPTS="-Dsynchrony.memory.max=2g ${CATALINA_OPTS}"
- With that done, still inside
Confluence-Installation-Directory/bin
, run the./start-confluence.sh
script. Don't forget to consult with your team to understand if you have customized scripts or not. In case you do, run your customized one. In case you don't, run the mentioned one. - Confluence will come up with Synchrony having the new allocated Heap.
It is possible to set the synchrony.memory.max
value in either a gigabyte or megabyte format.
When setting these values in megabytes, set the value by multiplying the desired memory level by 1024. For example, to set the memory at 2 gigabytes, configure the synchrony.memory.max
to 2048m (2 x 1024MB):
-Dsynchrony.memory.max=2048m
For the same example using gigabytes, simply use the following:
-Dsynchrony.memory.max=2g
When setting the value in gigabytes, do not use .5 increments as this will cause the JVM to not start properly.