You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "John Beaulaurier -X (jbeaulau - ADVANCED NETWORK INFORMATION INC at Cisco)" <jb...@cisco.com> on 2013/09/05 23:55:31 UTC

JVM options (where to configure)

Hello,

I would like to know where to place JVM HostSpot parameter flags in the Tomcat config files. I have read that
a  file named setenv.sh should be created in CATALINA_HOME/bin, and there you place the configs, yet I've also read that
you simply place them in catalina.sh. Which is the preferred? Also I've seen configurations with JAVA_OPS
and CATALINA_OPS. Which is the preferred there? 

OS: RHEL 5.5 
Kernel: 2.6.18-194.8.1.el5
Apache Tomcat: 7.0.39
JDK: 1.6.0_45

Thank you
-John 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JVM options (where to configure)

Posted by Neven Cvetkovic <ne...@gmail.com>.
On Thu, Sep 5, 2013 at 5:55 PM, John Beaulaurier -X (jbeaulau - ADVANCED
NETWORK INFORMATION INC at Cisco) <jb...@cisco.com> wrote:

> Hello,
>
> I would like to know where to place JVM HostSpot parameter flags in the
> Tomcat config files. I have read that
> a  file named setenv.sh should be created in CATALINA_HOME/bin, and there
> you place the configs, yet I've also read that
> you simply place them in catalina.sh. Which is the preferred? Also I've
> seen configurations with JAVA_OPS
> and CATALINA_OPS. Which is the preferred there?
>
> OS: RHEL 5.5
> Kernel: 2.6.18-194.8.1.el5
> Apache Tomcat: 7.0.39
> JDK: 1.6.0_45
>
>
Hey John,

My preferred way to use this is to create CATALINA_HOMEbin/setenv.sh (or
CATALINA_BASE/bin/setenv.sh if you have multi-instance setup) and add JVM
options to CATALINA_OPTS, rather than JAVA_OPTS.

JAVA_OPTS is going to be used for shutdown script as well, not just startup.
CATALINA_OPTS is going to be used for startup script only.

I prefer setenv.sh route, because it provides clear separation of the
product and configuration customizations. This is really handy when you do
upgrades!

Hope that helps!

Cheers
n.

Re: JVM options (where to configure)

Posted by Mark Thomas <ma...@apache.org>.
On 05/09/2013 22:55, John Beaulaurier -X (jbeaulau - ADVANCED NETWORK
INFORMATION INC at Cisco) wrote:
> Hello,
> 
> I would like to know where to place JVM HostSpot parameter flags in the Tomcat config files. I have read that
> a  file named setenv.sh should be created in CATALINA_HOME/bin, and there you place the configs, yet I've also read that
> you simply place them in catalina.sh. Which is the preferred?

setenv.[sh|bat] as appropriate for your platform.

> Also I've seen configurations with JAVA_OPS
> and CATALINA_OPS. Which is the preferred there?

Generally, CATALINA_OPTS

When Tomcat is stopped, a second process is created that creates a
connection to the shutdown port of the main process and provides the
shutdown command.

CATALINA_OPTS applies only the main process
JAVA_OPTS applies to both

You are unlikely to want your memory settings (or any other settinsg for
that matter) for the main process to be applied to the shutdown process.
Therefore use CATALINA_OPTS.

The comments in catalina.[sh|bat] cover this.

Mark


> 
> OS: RHEL 5.5 
> Kernel: 2.6.18-194.8.1.el5
> Apache Tomcat: 7.0.39
> JDK: 1.6.0_45
> 
> Thank you
> -John 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org