Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.

Allocating Additional Memory to Tomcat

Overview

If there is a large amount of data in the JSS, you may need to allocate additional memory to Tomcat.

Versions Affected

Casper Suite v8.3 and earlier

Note: If you are using v8.4 or later, see your product documentation for instructions on how to allocate additional memory to Tomcat.

Procedures

macOS

To allocate additional memory to Tomcat on macOS (v8.1 and earlier):

  1. Open the JSS Setup Utility and connect to your JSS.
  2. Under the Servers & Services heading, select the Web Application service.
  3. Click the Settings tab.
  4. Move the sliders for the memory settings.
  5. Click the Update button.

To allocate additional memory to Tomcat on macOS (v8.2 and 8.3):

  1. Convert the launchd item to XML by executing:
    sudo plutil -convert xml1 /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
  2. Open the launchd item by executing:
    sudo nano /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
  3. Allocate additional memory to Tomcat by modifying the string that begins with "Xmx".
  4. Save and close the file.
  5. Restart Tomcat. For instructions, see "Starting and Stopping Tomcat".

Linux

To allocate additional memory to Tomcat on Ubuntu or RHEL:
If you did not use the JSS Installer for a new JSS installation (even if you've used the JSS Installer to upgrade):

  1. On Ubuntu, edit the /etc/init.d/tomcat6 file. On RHEL, edit the /etc/tomcat6/tomcat6.conf file.
  2. Locate the JAVA_OPTS environment variable that defines memory and uncomment it if it is ?commented. This variable looks something like the following:
    JAVA_OPTS=" -XmxSizeM -XX:MaxPermSize=256M"
  3. Modify the -Xmx parameter to allocate additional memory to Tomcat. For example, if you need to allocate 1 GB of RAM, modify the variable to look something like this:
    JAVA_OPTS=" -Xmx1024M -XX:MaxPermSize=256M"
  4. Restart Tomcat. For instructions, see "Starting and Stopping Tomcat".

If you used the JSS Installer for a new installation (on a server that did not previously have the JSS installed):

  1. Locate and open the /usr/local/jss/tomcat/bin/setenv.sh file.
  2. Locate the JAVA_OPTS environment variable that defines memory and uncomment it if it is ?commented. The variable looks something like the following:
    JAVA_OPTS=" -XmxSizeM -XX:MaxPermSize=256M"
  3. Allocate additional memory to Tomcat by modifying the -Xmx parameter. For example, modifying the variable to look something like this allocates 1 GB of RAM:
    JAVA_OPTS=" -Xmx1024M -XX:MaxPermSize=256M"
  4. Save and close the file.
  5. Restart Tomcat. For instructions, see "Starting and Stopping Tomcat".

Windows

To allocate additional memory to Tomcat on Windows Server 2008: If you did not use the JSS Installer for a new JSS installation (even if you've used the JSS Installer to upgrade):

  1. From the menu bar, choose Start > All Programs > Apache Tomcat 6, and then open the Configure Tomcat application.
  2. Click the Java tab.
  3. Enter the amount of memory you want to allocate in the Maximum Memory Pool field.
  4. Click Apply.
  5. Open Command Prompt and restart Tomcat. For instructions on how to restart Tomcat, see "Starting and Stopping Tomcat".

If you used the JSS Installer for a new installation (on a server that did not previously have the JSS installed):

  1. Navigate to C:\Program Files\JSS\Tomcat\bin\tomcat7w.exe.
  2. Click the Java tab.
  3. In the Maximum Memory Pool field, enter the amount of memory you want to allocate to Tomcat and click Apply.
  4. Open Command Prompt and restart Tomcat. For instructions on restarting Tomcat, see "Starting and Stopping Tomcat".
CJA Badge

Posted: 9/11/13 at 4:09 PM by rcuza

On Debian the following files are used to set the JAVA_OPTS parameters for tomcat7:

/etc/init.d/tomcat7
/etc/defaults/tomcat7
/usr/share/tomcat7/bin/setenv.sh

I list the init.d script because that is where it starts and there is an `if [ -z "$JAVA_OPTS" ]` clause in there that will kick in if the defaults location doesn't set it first. You should make your changes to the defaults or setenv.sh. Because there was already a `-Xmx128m` set in the defaults location (on my debian 7.1 install), I put all my settings there. One could also put everything in setenv.sh, but you would still need to edit the defaults area to get rid of the existing Xmx.

CCA Badge CCE Badge CMA Badge CUG Badge

Posted: 4/24/14 at 12:15 PM by donmontalvo

Nice that Tomcat doesn't whack this setting (as of JSS 9) if we go past the GUI max... :)

Convert the file:

sudo plutil -convert xml1 /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist

...then use your favorite text editor to make the change:

vi /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist

...or for GUI fans:

open -a TextWrangler.app /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist

...then convert the file back:

sudo plutil -convert binary1 /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist

...lastly bounce Tomcat:

sudo launchctl unload /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
sudo launchctl load /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist

I didn't find anything in the JSS 9.3 manual:

Note: If you are using v8.4 or later, see your product documentation for instructions on how to allocate additional memory to Tomcat.
CCT Badge CCA Badge CCE Badge CJA Badge JAMFBadge

Posted: 7/15/16 at 9:29 AM by xlouiex

optional image ALT text

In case we need to increase MaxPermSize manually on Windows. Program Files/JSS/Tomcat/Bin/tomcat7w.exe

CCA Badge CJA Badge CMA Badge Integrator Badge

Posted: 10/11/16 at 1:06 PM by nlucia

On the Linux install, shouldn't memory limits be assigned via the CATALINA_OPTS? Just reading through the RUNNING.txt that comes with Tomcat and it states...

Note: Do not use JAVA_OPTS to specify memory limits. You do not need much memory for a small process that is used to stop Tomcat. Those settings belong to CATALINA_OPTS.
CJA Badge

Posted: 10/12/16 at 11:30 AM by henryxyz

My understanding. IF you are ONLY running Tomcat on the server for the JSS, using Catalina_opts or Java_Opts will have the same effect. However, if you have another application on the server, specifically one using Java, then you have to choose wisely. Catalina_opts is oriented towards Tomcat while Java_opts is oriented for ALL Java applications on the server. For simplicity of administration, I would use one or the other for a JSS ONLY server. My choice would be Catalina_opts for a JSS only server.

CCA Badge CMA Badge

Posted: 11/17/16 at 11:31 AM by csm0004

Linux New Install:

If you used the JSS Installer for a new installation (on a server that did not previously have the JSS installed): Locate and open the /usr/local/jss/tomcat/bin/catalina.sh file. Locate the JAVA_OPTS environment variable that defines memory and uncomment it if it is ?commented. The variable looks something like the following: JAVA_OPTS=" -XmxSizeM -XX:MaxPermSize=256M" Allocate additional memory to Tomcat by modifying the -Xmx parameter. For example, modifying the variable to look something like this allocates 1 GB of RAM: JAVA_OPTS=" -Xmx1024M -XX:MaxPermSize=256M" Save and close the file. Restart Tomcat. For instructions, see "Starting and Stopping Tomcat".

The rcuza's comment above is correct. You will find the environment variables in setenv.sh in the same directory. /usr/local/jss/tomcat/bin/setenv.sh
Used this to allocate 4G of memory:
export JAVA_OPTS="$JAVA_OPTS -Xmx4096M -Xms -Djava.awt.headless=true"

or you can modify the CATALINA_OPTS. I used this to increase to 6G
export CATALINA_OPTS="$CATALINA_OPTS -Xmx6091 -XX:PermSize=256m -XX:MaxPermSize=256m"

That seemed a little cleaner given the line was already in setenv.sh and I only had to add -Xmx6091. Just as stated by henryxyz above, both JAVA_OPTS and CATALINA_OPTS seem to work. CATALINA_OPTS might be a better option if you run multiple Java applications. Using setenv.sh is kind of cool because it lets you make changes without mucking up the main script for Catalina. I included before and after pics below.