Configuring Java heap space
The page instructs on how to manually set the memory limits for Cassandra's Java Virtual Machine (JVM).
Configuring Java heap space for Cassandra
To configure the Java Heap space for Cassandra, you must explicitly set the standard JVM arguments, -Xms (initial) and -Xmx (maximum), in the appropriate JVM options file jvmXX-server.options.
- Default file location: /etc/cassandra/conf/jvmXX-server.options
- You may need to add the -Xms/-Xmx lines if missing, or edit the existing.
- Replace
jvmXXwith your installed Java version (read requirements for deployed version).
The JVM Heap Size (-Xmx) must never exceed 50% of the total physical system RAM.
For example, when Cassandra is running on a dedicated server, and the server has 64 GB of RAM, you might set the heap (Xmx) to 16 GB and not more than 32 GB, even if the server has more than 64 GB of RAM.
This statement is technically accurate and hits the following key points:
50% Rule: It correctly uses the 50% rule (32 GB is 50% of 64 GB) as the absolute maximum.
Best Practice: It suggests the best-practice range by using 16 GB as a likely setting.
Maximum Cap: It reinforces that the 32 GB limit is a ceiling, even if the total physical RAM is much larger than 64 GB.
Edit jvmXX-server.options and add the lines regarding your need:
Example:
-Xmx16G
-Xms8G
Otherwise, Cassandra will calculate the heap size based on the system's memory. The automatic heap size calculation is capped to 15872 MB (≈15.5 GB) when using the modern G1 Garbage Collector (which is the default).
This logic is highly conservative, which is why manual tuning of the heap (-Xmx) is the recommended best practice for high-performance servers.
The formula details are outlined below:
- For the system memory 16 GB: use 8 GB.
- For the system memory more than 32 GB: use 15.5 GB.
- For the system memory 64 GB: use 15.5 GB.
Configuring Java heap space for Magic Collaboration Studio
On Linux
- If you start Magic Collaboration Studio from the executable twcloud file, you can configure the -Xmx parameter from the file jvm.options (located in the same folder).
On Windows
- If you start Magic Collaboration Studio from the executable file twcloud.exe, you can configure the -Xmx parameter from the file jvm.options (located in the same folder).
- If you start Magic Collaboration Studio from a Windows service, you must use the Registry Editor to update the value.
To change the value using the Registry Editor
1. Run regedit from the command line.
2. Browse for the key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\Teamwork Cloud\Parameters\Java.
3. Right-click JvmMx and select Modify....
4. Select Base to Decimal and change the value. The value is in megabytes (mb).
Configuring Java heap space for Web Application Platform
Heap space for Web Application Platform is handled by Tomcat.
On Linux
- Heap settings are located in <install_root>/WebAppPlatform/bin/setenv.sh
JVM_OPTS="-server -XX:+UseParallelGC -Xms4096M -Xmx8192M"
On Windows
- The heap setting for Web Application Platform is located in the registry
To change the value using the Registry Editor
1. Run regedit from the command line.
2. Browse for the key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\WebApp\Parameters\Java.
3. Right-click JvmMx and select Modify....
4. Select Base to Decimal and change the value. The value is in megabytes (mb).