# Tomcat java memory setting location

**URL:** <https://forums.suse.com/t/tomcat-java-memory-setting-location/30486>\
**Category:** SLES Configure-Administer\
**Created:** [October 30, 2017, 6:27pm UTC](https://forums.suse.com/t/tomcat-java-memory-setting-location/30486 "2017-10-30T18:27:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cisaksen](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@cisaksen](https://forums.suse.com/u/cisaksen)\
**Post date:** [October 30, 2017, 6:27pm UTC](https://forums.suse.com/t/tomcat-java-memory-setting-location/30486/1 "2017-10-30T18:27:14Z")

</div>

I’m looking for the proper java memory settings for tomcat.

I’m looking at /etc/tomcat/tomcat.conf " JAVA\_OPTS" but i’m not sure if this is the right place to add the -Xms521m

I have found references to CATALINA\_OPTS in other articles but not sure which one I should use in SUES.

Thanks

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [October 30, 2017, 7:41pm UTC](https://forums.suse.com/t/tomcat-java-memory-setting-location/30486/2 "2017-10-30T19:41:39Z")

</div>

Hi  
I’m currently on SLES 12 SP3 with SuMA which runs tomcat, I see JAVA\_OPT’s in use for this rather than CATALINA\_OPTS;

[CODE]  
tomcat.conf:JAVA\_OPTS="-ea -Xms256m -Xmx1G …

ps -ef |grep tomcat  
tomcat 1853 1 0 Oct28 ? 00:03:38 /etc/alternatives/jre/bin/java -ea -Xms256m …

[CODE]

---

<div class="post-metadata">

**Author:** ![cisaksen](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@cisaksen](https://forums.suse.com/u/cisaksen)\
**Post date:** [October 30, 2017, 8:14pm UTC](https://forums.suse.com/t/tomcat-java-memory-setting-location/30486/3 "2017-10-30T20:14:11Z")

</div>

I tried the setting (JAVA\_OPT) in the /etc/tomcat/tomcat.conf and it had no effect, but I found a old article in the suse knowledge base and that seem to still work. [https://www.novell.com/support/kb/doc.php?id=7010072](https://www.novell.com/support/kb/doc.php?id=7010072)

/etc/sysconfig/tomcat add CATALINA\_OPT="-Xms256m -Xmx512m -Xss512k" (as an example) as a single line in the file without the export in front. This worked and gave me the expected results in the tomcat management page.

thanks for the help

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [October 31, 2017, 2:06am UTC](https://forums.suse.com/t/tomcat-java-memory-setting-location/30486/4 "2017-10-31T02:06:26Z")

</div>

Thank-you for posting back your results. I am pretty sure in the past  
when I adjusted Tomcat I did so via the conf file too, but it may be that  
in your case the conf file is managed via sysconfig files. Usually in  
those cases the conf files themselves start with comments stating  
something like, “Do not modify this file directory.” indicating it is  
overwritten at runtime by something else.

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

**Author:** ![christianmolecki](https://avatars.discourse-cdn.com/v4/letter/c/e95f7d/32.png) [@christianmolecki](https://forums.suse.com/u/christianmolecki)\
**Post date:** [November 7, 2017, 9:38am UTC](https://forums.suse.com/t/tomcat-java-memory-setting-location/30486/5 "2017-11-07T09:38:56Z")

</div>

Hello cisaksen,

we create a setenv.sh file in $Tomcat\_Home/bin.  
There you can also define the Java\_Home variable.

[CODE]#!/bin/sh

export JAVA\_HOME=/web/java/jdk1.8.0\_151  
export PATH=$PATH:$JAVA\_HOME/bin

#Increase java heap size  
CATALINA\_OPTS="$CATALINA\_OPTS -Xms4096m -Xmx4096m"

#Enable JMX Remote port  
CATALINA\_OPTS="$CATALINA\_OPTS -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

export CATALINA\_OPTS[/CODE]

Best Regards  
Christian
