Posted on 03-06-2014 02:44 PM
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 :(
Solved! Go to Solution.
Posted on 03-06-2014 05:09 PM
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
Posted on 03-06-2014 03:02 PM
http://resources.jamfsoftware.com/documents/products/documentation/Casper-Suite-9.2-JSS-Installation-Guide-for-Linux.pdf
Posted on 03-06-2014 03:02 PM
look for the maximum PermGen
Posted on 03-06-2014 03:10 PM
This is a headless Linux serve with no GUI. the java util won't work. I was looking for the file to edit
Posted on 03-06-2014 03:11 PM
and we are still on 8.73
Posted on 03-06-2014 05:09 PM
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
Posted on 03-07-2014 01:16 AM
@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/
Posted on 03-07-2014 06:41 AM
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
Posted on 03-07-2014 06:47 AM
@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...
Posted on 03-18-2014 09:57 AM
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!
Posted on 08-22-2014 10:52 PM
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
Posted on 08-25-2014 10:17 AM
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