You may want to increase Tomcat memory for clustered Jamf Pro web apps. By default only 1Gb of memory is allocated to Tomcat. Increasing the memory can significantly improve performance. Normally you would use the database utility to change these settings, but in a clustered environment you manually change the plist. (For Linux instructions click here.) These 6 steps have been compiled from documentation on JAMF-Nation.
It is important to check memory allocation for the web app after each update as some releases will reset them back to default. I encountered that recently and it caused major problems for my end users downloading apps from Self Service. Having these steps to increase Tomcat memory allocation comes in handy.
To increase Tomcat memory in macOS, use the steps below which will walk you through the process.
- convert the correct plist to an xml file,
- change the settings,
- convert the plist back to a binary, and then
- restart Tomcat.
I have verified that these steps work with JAMFPro versions 8.3 through 9.98.
Open the Terminal app on the mac running Tomcat or connect to it via ssh from a remote computer. You must be logged in with an administrator account.
1. Convert the plist to an editable XML file
In Terminal type the following:
sudo plutil -convert xml1 /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
2. Edit the Tomcat plist
Use either vi or nano to edit the plist in terminal. The example below uses the vi editor.
or you can use an app like TextWrangler if you prefer a GUI.
open -a TextWrangler.app /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
3. Increase Tomcat memory settings
Locate the string that begins with <string>-Xmx and modify the settings in increments of 1024.
4. Convert the tomcat plist back to a binary
Once you have quit and saved the plist, you need to convert it back to a binary using the following:
sudo plutil -convert binary1 /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
5. Restart Tomcat
If you don’t know these commands already, memorize them. I use them so often my wife says I mumble them in my sleep.
sudo launchctl unload /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
sudo launchctl load /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
6. Check your work
Navigate to the JAMFPro server web app you just modified and check the Memory Usage under Settings->JSS Information->Memory Usage tab. You should see a graph showing how much memory Tomcat is using.
Thanks to JAMF Software and JAMF-Nation user, donmmontalvo, for listing the steps in the KB referenced in this article. For additional information on performance tuning, check out Der Flounder’s documentation.