We are encountering errors and/or slowness associated with java.lang.OutOfMemoryError in the ws.log file. How do we change the Java Heap memory size on the server where WorldServer is installed and allocate more memory? |
Note: changing the Java Memory settings is typically considered a tuning exercise. Depending on the environment, different values may work for different setups. Please refer to the System requirement page in our RWS Documentation Center. When changing the Java Heap settings, it is suggested to double the number currently in place (i.e. from 128 to 256) and monitor the system further. If issues are still seen, especially slowness associated with out-of-memory errors in the ws.log), try doubling again so 512, 1024 etc. The Java Memory settings are stored in the WorldServer\tomcat\bin directory. Follow these steps: 1- Before making any changes, stop WorldServer (Idiom service). Note that the User Interface will be unavailable. 2- Open/double-click on the IdiomRunw.exe or the WorldServerTomcatServicew.exe file and go to the Java tab. Note: depending on how you have installed WorldServer, you might not find IdiomRunw.exe. If that is the case, refer to tomcat9w.exe instead and follow the same steps. In WorldServer 11.8.+, you will find WorldServerTomcatServicew.exe. 3- In the Java Options field, scroll down and you will find the Java Memory values that you can change. Per default, these are set to 2 GB of allocated memory: -Xms1024m -Xmx2048m If you want to increase them to 4 GB, change the values to -Xms1024m -Xmx4096m If you want to increase them to 6 GB, change the values to -Xms1024m -Xmx6144m If you want to increase them to 8 GB, change the values to -Xms1024m -Xmx8192m If you want to increase them to 10 GB, change the values to -Xms1024m -Xmx10240m If you want to increase them to 12 GB, change the values to -Xms1024m -Xmx12288m If you want to increase them to 20 GB, change the values to -Xms1024m -Xmx20480m 4- Change the Xmx value as well, if required 5- Click OK and restart WorldServer (Idiom service) for the change to take effect. You can enter the same values in the Initial Memory Pool and in the Maximum Memory Pool for consistency before confirming the change. As an example, see screenshot below where Java Heap has been set to Max 8 GB: |
For Linux-based environments: WorldServer: How can I add or change the Java options passed to Tomcat on Linux-based systems? For WorldServer 10.4.4. and earlier versions, please refer to: Tuning performance of WorldServer 10.4.5. and earlier versions by changing the Java max Heap settings |