Skip to main content
Solved

Adding more Ram to Tomcat - Headless Linux server


Forum|alt.badge.img+4

I was hoping to know if anyone can tell me how to give more RAM to tomcat on a headless linux server. I feel really stupid posting this since I am a CJA :(

Best answer by nessts

there are command line instructions, essentially you create this file /usr/local/jss/tomcat/bin/setenv.sh that contains or whatever memory options you want. I believe
JAVA_OPTS=" -Xmx2048M -XX:MaxPermSize=512M
and just restart tomcat

View original
Did this topic help you find an answer to your question?

11 replies

Forum|alt.badge.img+18
  • Valued Contributor
  • 1007 replies
  • March 6, 2014

http://resources.jamfsoftware.com/documents/products/documentation/Casper-Suite-9.2-JSS-Installation-Guide-for-Linux.pdf


Forum|alt.badge.img+18
  • Valued Contributor
  • 1007 replies
  • March 6, 2014

look for the maximum PermGen


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 12 replies
  • March 6, 2014

This is a headless Linux serve with no GUI. the java util won't work. I was looking for the file to edit


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 12 replies
  • March 6, 2014

and we are still on 8.73


Forum|alt.badge.img+18
  • Valued Contributor
  • 1007 replies
  • Answer
  • March 7, 2014

there are command line instructions, essentially you create this file /usr/local/jss/tomcat/bin/setenv.sh that contains or whatever memory options you want. I believe
JAVA_OPTS=" -Xmx2048M -XX:MaxPermSize=512M
and just restart tomcat


Forum|alt.badge.img+23
  • Esteemed Contributor
  • 850 replies
  • March 7, 2014

@bjbechd The issue i've found is that the file to alter varies wildly depending on how you installed tomcat. The JAMF supplied installer, because it places tomcat in a different location, the file to be changed is in a completely different place than if you installed everything manually.

I've had some success altering the catalina.sh file in $CATALINA_HOME/bin/


Forum|alt.badge.img+4
  • Contributor
  • 14 replies
  • March 7, 2014

On 8.73/9.22, we used to modify the jamf.tomcat7 file found in /etc/init.d:

export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Xmx8192m -Xms8192m -XX:MaxPermSize=1024m"

Due to what appears to be a re-write of the jamf.tomcat7 script, on 9.24, we modify the catalina.sh file that's found in /usr/local/jss/tomcat/bin:

JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Xmx8192m -Xms8192m -XX:MaxPermSize=1024m"

Edit: This is on CentOS 6.4 and gives Tomcat 8GB of RAM (minimum and maximum) with 1GB of PermGen


Forum|alt.badge.img+18
  • Valued Contributor
  • 1007 replies
  • March 7, 2014

@mml7 if you read the first couple of paragraphs they ask that you create the setenv.sh instead so that your customizations live through upgrades...


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 12 replies
  • March 18, 2014

Thanks everyone for the replies. I got it taken care of. It all was the setenv.sh file that did what I needed to do. Thanks!


Forum|alt.badge.img+3
  • New Contributor
  • 9 replies
  • August 23, 2014

For sake of completeness, with Casper 9.4 on Ubuntu with the JSS manually installed I had to place the setenv.sh file at this path:

/usr/share/tomcat7/bin/setenv.sh

Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • August 25, 2014

Hi Everyone,

I just wanted to chime in here and expand on what is being discussed here. There are three ways to set memory for Tomcat in Linux. You can modify the JAVA_OPTS in three places, the catalina.sh, the setenv.sh, and in the tomcat startup scripts (you can spawn the Tomcat process with JAVA_OPTS). The best practice via the Tomcat documentation is the setenv.sh. All three ways accomplish the same goal, but the setenv.sh is not present by default. You must create it. Ideally, if you are managing multiple Tomcats, you wouldn't have to touch any config files and you can just drop the setenv.sh file in your Tomcat home folder, and be done with it, and it will scale better since Tomcat does not modify/deploy a new setenv.sh file during any upgrades or migrations.

Thanks,
Tom


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings