You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Noelette Stout <no...@isu.edu> on 2021/06/16 14:35:30 UTC

CATALINA_OPTS vs JAVA_OPTS

If I have a setenv.sh file that contains:
CATALINA_OPTS="-server -Xms2048m -Xmx5g"
JAVA_OPTS="... -Xms2048m -Xmx4g .."

How much memory is actually being allocated to tomcat and the applications
it is serving up?

-- 
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Mark Thomas <ma...@apache.org>.
And to expand on one other point, the shutdown mechanism is different 
for the Windows Service (assuming you are using default jvm mode). You 
don't have to worry about creating a whole new Java process just to send 
the shutdown command to the shutdown port.

Mark


On 16/06/2021 21:47, Christopher Schultz wrote:
> Jon,
> 
> On 6/16/21 14:31, jonmcalexander@wellsfargo.com.INVALID wrote:
>> Ok, so this is a really good explanation. However, when setting up in
>> Windows as a Service, does the JAVA_OPTIONS in the Registry go in as
>> JAVA_OPTS or CATALINA_OPTS? Is there a way to have separate
>> CATALINA_OPTS for Tomcat Windows Services?
> 
> It's more complicated than you are making it seem.
> 
> If you use service.bat to create your Windows Service definition, then 
> the effective CATALINA_OPTS and JAVA_OPTS environment variable values 
> within the shell at the time you call bin\service.bat will have the 
> intended effect: they will combine and set the values which go into the 
> registry for that Service. When you launch the service, the (current) 
> values of CATALINA_OPTS and JAVA_OPTS, if they exist, are completely 
> ignored because the Service definition captured them at creation-time.
> 
> If you want to alter them, you can either set their values again, and 
> delete/re-create the service using bin\service.bat or you can use 
> tomcatXw.exe to edit the service values directly.
> 
> You have to remember that Windows, while supporting environment 
> variables nearly through-and-through, essentially encourages all 
> self-respecting Windows admins to ignore those environment variables. 
> Everything is done through the registry and so the Tomcat config scripts 
> attempt to bridge the gap between the gray beard UNIX admins who are 
> used to things like CATALINA_OPTS and JAVA_OPTS and whatnot and the 
> Windows admins who have an entirely different mental-model of system 
> services.
> 
> It's a neat little hack IMHO: let the CLI warriors set environment 
> variables and create a Service. The Service captures those values into 
> the more Windowsey paradigm, and off you go. And none of the Windows 
> admins have to bother themselves with environment variables.
> 
> -chris
> 
>>> -----Original Message----- From: Christopher Schultz
>>> <ch...@christopherschultz.net> Sent: Wednesday, June 16, 2021 11:14
>>> AM To: users@tomcat.apache.org Subject: Re: CATALINA_OPTS vs
>>> JAVA_OPTS
>>>
>>> Noelette,
>>>
>>> On 6/16/21 11:29, Noelette Stout wrote:
>>>> Thanks! I was mostly trying to figure out if there was precedence
>>>> or if it was additive (i.e. 2GB to tomcat itself and another 2GB
>>>> to the apps). We're having some resource issues on one of our
>>>> servers, so I wanted to make sure I understood how the resources
>>>> were being
>>> allocated.
>>>
>>> No additivity at all: the last one on the command-line wins. There
>>> is no heap separation between Tomcat and the applications: it's
>>> one(ish) big, happy heap. :)
>>>
>>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the
>>> various scripts provided by Tomcat, CATALINA_OPTS is only used when
>>> launching a Tomcat instance. JAVA_OPTS is used when launching *any*
>>> Java process. There are many Java processes those scripts will
>>> launch that aren't actually launching Tomcat. Examples include:
>>>
>>> 1. catalina.sh configtest 2. catalina.sh stop (also shutdown.sh) 3.
>>> catalina.sh version 4. tool-wrapper.sh [anything]
>>>
>>> In all of those cases, JAVA_OPTS will be passed to the JVM.
>>>
>>> Do you really need a 2 gig heap to send a "shutdown" command to a
>>> running server? Probably not.
>>>
>>> -chris
>>>
>>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent
>>>> <rs...@xmission.com>
>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
>>>>>> openjdk version "1.8.0_292"
>>>>>>
>>>>>>
>>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent
>>>>>> <rs...@xmission.com>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>> Both as for the same minimum so you should get 2G at start up.
>>>>> I'm not sure which has precedency but I would be on java opt.
>>>>> I don't have a catalina env, but you can see how CATALINA_OPTS
>>>>> is used in relationship with JAVA_OPTS
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>>
>>>>>
> 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
>>
>>
>> ---------------------------------------------------------------------
>>
>>
> 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
> 


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


RE: CATALINA_OPTS vs JAVA_OPTS

Posted by jo...@wellsfargo.com.INVALID.
Thanks Chris!

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexander@wellsfargo.com

Upcoming PTO: 10/30/2020, 11/6/2020, 11/13/2020, 11/20/2020, 11/27/2020, 12/2/2020, 12/4/2020, 12/11/2020, 12/18/2020, 12/28/2020, 12/29/2020, 12/30/2020, 12/31/2020
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.


> -----Original Message-----
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Wednesday, June 16, 2021 3:48 PM
> To: users@tomcat.apache.org
> Subject: Re: CATALINA_OPTS vs JAVA_OPTS
> Importance: Low
> 
> Jon,
> 
> On 6/16/21 14:31, jonmcalexander@wellsfargo.com.INVALID wrote:
> > Ok, so this is a really good explanation. However, when setting up in
> > Windows as a Service, does the JAVA_OPTIONS in the Registry go in as
> > JAVA_OPTS or CATALINA_OPTS? Is there a way to have separate
> > CATALINA_OPTS for Tomcat Windows Services?
> 
> It's more complicated than you are making it seem.
> 
> If you use service.bat to create your Windows Service definition, then the
> effective CATALINA_OPTS and JAVA_OPTS environment variable values
> within the shell at the time you call bin\service.bat will have the intended
> effect: they will combine and set the values which go into the registry for
> that Service. When you launch the service, the (current) values of
> CATALINA_OPTS and JAVA_OPTS, if they exist, are completely ignored
> because the Service definition captured them at creation-time.
> 
> If you want to alter them, you can either set their values again, and
> delete/re-create the service using bin\service.bat or you can use
> tomcatXw.exe to edit the service values directly.
> 
> You have to remember that Windows, while supporting environment
> variables nearly through-and-through, essentially encourages all self-
> respecting Windows admins to ignore those environment variables.
> Everything is done through the registry and so the Tomcat config scripts
> attempt to bridge the gap between the gray beard UNIX admins who are
> used to things like CATALINA_OPTS and JAVA_OPTS and whatnot and the
> Windows admins who have an entirely different mental-model of system
> services.
> 
> It's a neat little hack IMHO: let the CLI warriors set environment variables and
> create a Service. The Service captures those values into the more
> Windowsey paradigm, and off you go. And none of the Windows admins
> have to bother themselves with environment variables.
> 
> -chris
> 
> >> -----Original Message----- From: Christopher Schultz
> >> <ch...@christopherschultz.net> Sent: Wednesday, June 16, 2021 11:14
> >> AM To: users@tomcat.apache.org Subject: Re: CATALINA_OPTS vs
> >> JAVA_OPTS
> >>
> >> Noelette,
> >>
> >> On 6/16/21 11:29, Noelette Stout wrote:
> >>> Thanks! I was mostly trying to figure out if there was precedence or
> >>> if it was additive (i.e. 2GB to tomcat itself and another 2GB to the
> >>> apps). We're having some resource issues on one of our servers, so I
> >>> wanted to make sure I understood how the resources were being
> >> allocated.
> >>
> >> No additivity at all: the last one on the command-line wins. There is
> >> no heap separation between Tomcat and the applications: it's
> >> one(ish) big, happy heap. :)
> >>
> >> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the
> various
> >> scripts provided by Tomcat, CATALINA_OPTS is only used when launching
> >> a Tomcat instance. JAVA_OPTS is used when launching *any* Java
> >> process. There are many Java processes those scripts will launch that
> >> aren't actually launching Tomcat. Examples include:
> >>
> >> 1. catalina.sh configtest 2. catalina.sh stop (also shutdown.sh) 3.
> >> catalina.sh version 4. tool-wrapper.sh [anything]
> >>
> >> In all of those cases, JAVA_OPTS will be passed to the JVM.
> >>
> >> Do you really need a 2 gig heap to send a "shutdown" command to a
> >> running server? Probably not.
> >>
> >> -chris
> >>
> >>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
> >> wrote:
> >>>
> >>>>
> >>>>
> >>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
> >>>>> openjdk version "1.8.0_292"
> >>>>>
> >>>>>
> >>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent
> >>>>> <rs...@xmission.com>
> >>>> wrote:
> >>>>>
> >>>>>
> >>>> Both as for the same minimum so you should get 2G at start up.
> >>>> I'm not sure which has precedency but I would be on java opt.
> >>>> I don't have a catalina env, but you can see how CATALINA_OPTS is
> >>>> used in relationship with JAVA_OPTS
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> --
> >>>>
> >>>>
> 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
> >
> >
> > ---------------------------------------------------------------------
> >
> >
> 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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 6/16/21 14:31, jonmcalexander@wellsfargo.com.INVALID wrote:
> Ok, so this is a really good explanation. However, when setting up in
> Windows as a Service, does the JAVA_OPTIONS in the Registry go in as
> JAVA_OPTS or CATALINA_OPTS? Is there a way to have separate
> CATALINA_OPTS for Tomcat Windows Services?

It's more complicated than you are making it seem.

If you use service.bat to create your Windows Service definition, then 
the effective CATALINA_OPTS and JAVA_OPTS environment variable values 
within the shell at the time you call bin\service.bat will have the 
intended effect: they will combine and set the values which go into the 
registry for that Service. When you launch the service, the (current) 
values of CATALINA_OPTS and JAVA_OPTS, if they exist, are completely 
ignored because the Service definition captured them at creation-time.

If you want to alter them, you can either set their values again, and 
delete/re-create the service using bin\service.bat or you can use 
tomcatXw.exe to edit the service values directly.

You have to remember that Windows, while supporting environment 
variables nearly through-and-through, essentially encourages all 
self-respecting Windows admins to ignore those environment variables. 
Everything is done through the registry and so the Tomcat config scripts 
attempt to bridge the gap between the gray beard UNIX admins who are 
used to things like CATALINA_OPTS and JAVA_OPTS and whatnot and the 
Windows admins who have an entirely different mental-model of system 
services.

It's a neat little hack IMHO: let the CLI warriors set environment 
variables and create a Service. The Service captures those values into 
the more Windowsey paradigm, and off you go. And none of the Windows 
admins have to bother themselves with environment variables.

-chris

>> -----Original Message----- From: Christopher Schultz
>> <ch...@christopherschultz.net> Sent: Wednesday, June 16, 2021 11:14
>> AM To: users@tomcat.apache.org Subject: Re: CATALINA_OPTS vs
>> JAVA_OPTS
>> 
>> Noelette,
>> 
>> On 6/16/21 11:29, Noelette Stout wrote:
>>> Thanks! I was mostly trying to figure out if there was precedence
>>> or if it was additive (i.e. 2GB to tomcat itself and another 2GB
>>> to the apps). We're having some resource issues on one of our
>>> servers, so I wanted to make sure I understood how the resources
>>> were being
>> allocated.
>> 
>> No additivity at all: the last one on the command-line wins. There
>> is no heap separation between Tomcat and the applications: it's
>> one(ish) big, happy heap. :)
>> 
>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the
>> various scripts provided by Tomcat, CATALINA_OPTS is only used when
>> launching a Tomcat instance. JAVA_OPTS is used when launching *any*
>> Java process. There are many Java processes those scripts will
>> launch that aren't actually launching Tomcat. Examples include:
>> 
>> 1. catalina.sh configtest 2. catalina.sh stop (also shutdown.sh) 3.
>> catalina.sh version 4. tool-wrapper.sh [anything]
>> 
>> In all of those cases, JAVA_OPTS will be passed to the JVM.
>> 
>> Do you really need a 2 gig heap to send a "shutdown" command to a
>> running server? Probably not.
>> 
>> -chris
>> 
>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent
>>> <rs...@xmission.com>
>> wrote:
>>> 
>>>> 
>>>> 
>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
>>>>> openjdk version "1.8.0_292"
>>>>> 
>>>>> 
>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent
>>>>> <rs...@xmission.com>
>>>> wrote:
>>>>> 
>>>>> 
>>>> Both as for the same minimum so you should get 2G at start up.
>>>> I'm not sure which has precedency but I would be on java opt.
>>>> I don't have a catalina env, but you can see how CATALINA_OPTS
>>>> is used in relationship with JAVA_OPTS
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>>
>>>> 
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
> 
> 
> ---------------------------------------------------------------------
>
> 
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


RE: CATALINA_OPTS vs JAVA_OPTS

Posted by jo...@wellsfargo.com.INVALID.
Yes, but ultimately it is running Java, so was curious. Is there even a need of both when running as a Windows service? These are probably "duh" questions, but just want to fully "get it".

Thanks,

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexander@wellsfargo.com

Upcoming PTO: 10/30/2020, 11/6/2020, 11/13/2020, 11/20/2020, 11/27/2020, 12/2/2020, 12/4/2020, 12/11/2020, 12/18/2020, 12/28/2020, 12/29/2020, 12/30/2020, 12/31/2020
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.


> -----Original Message-----
> From: Olaf Kock <to...@olafkock.de>
> Sent: Wednesday, June 16, 2021 1:45 PM
> To: users@tomcat.apache.org
> Subject: Re: CATALINA_OPTS vs JAVA_OPTS
> 
> Service configurations are service configurations. You won't run the other
> options as service, so those are for the JVM that is used for the service. And
> I'm not aware that a service is stopped as the command line version. At least
> I'd hope so - a standard JVM would be good enough, if the start/stop
> mechanism not handled in the windows executable anyway.
> 
> Note: This is dangerous half-knowledge. I haven't been on Windows for
> ages, just read about it still being around from time to time.
> 
> CATALINA_OPTS is utilized by the startup batch/script file, which is not used
> for services /at all/.
> 
> Olaf
> 
> On 16.06.21 20:31, jonmcalexander@wellsfargo.com.INVALID wrote:
> > Ok, so this is a really good explanation. However, when setting up in
> Windows as a Service, does the JAVA_OPTIONS in the Registry go in as
> JAVA_OPTS or CATALINA_OPTS? Is there a way to have separate
> CATALINA_OPTS for Tomcat Windows Services?
> >
> > Thanks,
> >
> > Dream * Excel * Explore * Inspire
> > Jon McAlexander
> > Infrastructure Engineer
> > Asst Vice President
> >
> > Middleware Product Engineering
> > Enterprise CIO | Platform Services | Middleware | Infrastructure
> > Solutions
> >
> > 8080 Cobblestone Rd | Urbandale, IA 50322
> > MAC: F4469-010
> > Tel 515-988-2508 | Cell 515-988-2508
> >
> > jonmcalexander@wellsfargo.com
> >
> > Upcoming PTO: 10/30/2020, 11/6/2020, 11/13/2020, 11/20/2020,
> > 11/27/2020, 12/2/2020, 12/4/2020, 12/11/2020, 12/18/2020, 12/28/2020,
> 12/29/2020, 12/30/2020, 12/31/2020 This message may contain confidential
> and/or privileged information. If you are not the addressee or authorized to
> receive this for the addressee, you must not use, copy, disclose, or take any
> action based on this message or any information herein. If you have received
> this message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation.
> >
> >> -----Original Message-----
> >> From: Christopher Schultz <ch...@christopherschultz.net>
> >> Sent: Wednesday, June 16, 2021 11:14 AM
> >> To: users@tomcat.apache.org
> >> Subject: Re: CATALINA_OPTS vs JAVA_OPTS
> >>
> >> Noelette,
> >>
> >> On 6/16/21 11:29, Noelette Stout wrote:
> >>> Thanks! I was mostly trying to figure out if there was precedence or
> >>> if it was additive (i.e. 2GB to tomcat itself and another 2GB to the
> >>> apps). We're having some resource issues on one of our servers, so I
> >>> wanted to make sure I understood how the resources were being
> >> allocated.
> >>
> >> No additivity at all: the last one on the command-line wins. There is
> >> no heap separation between Tomcat and the applications: it's one(ish)
> >> big, happy heap. :)
> >>
> >> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the
> various
> >> scripts provided by Tomcat, CATALINA_OPTS is only used when launching
> >> a Tomcat instance. JAVA_OPTS is used when launching *any* Java
> process.
> >> There are many Java processes those scripts will launch that aren't
> >> actually launching Tomcat. Examples include:
> >>
> >> 1. catalina.sh configtest
> >> 2. catalina.sh stop (also shutdown.sh) 3. catalina.sh version 4.
> >> tool-wrapper.sh [anything]
> >>
> >> In all of those cases, JAVA_OPTS will be passed to the JVM.
> >>
> >> Do you really need a 2 gig heap to send a "shutdown" command to a
> >> running server? Probably not.
> >>
> >> -chris
> >>
> >>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
> >> wrote:
> >>>>
> >>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
> >>>>> openjdk version "1.8.0_292"
> >>>>>
> >>>>>
> >>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent
> >>>>> <rs...@xmission.com>
> >>>> wrote:
> >>>>>
> >>>> Both as for the same minimum so you should get 2G at start up.  I'm
> >>>> not sure which has precedency but I would be on java opt.  I don't
> >>>> have a catalina env, but you can see how CATALINA_OPTS is used in
> >>>> relationship with JAVA_OPTS
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> -- 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
> >
> > ---------------------------------------------------------------------
> > 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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Olaf Kock <to...@olafkock.de>.
Service configurations are service configurations. You won't run the
other options as service, so those are for the JVM that is used for the
service. And I'm not aware that a service is stopped as the command line
version. At least I'd hope so - a standard JVM would be good enough, if
the start/stop mechanism not handled in the windows executable anyway.

Note: This is dangerous half-knowledge. I haven't been on Windows for
ages, just read about it still being around from time to time.

CATALINA_OPTS is utilized by the startup batch/script file, which is not
used for services /at all/.

Olaf

On 16.06.21 20:31, jonmcalexander@wellsfargo.com.INVALID wrote:
> Ok, so this is a really good explanation. However, when setting up in Windows as a Service, does the JAVA_OPTIONS in the Registry go in as JAVA_OPTS or CATALINA_OPTS? Is there a way to have separate CATALINA_OPTS for Tomcat Windows Services?
>
> Thanks,
>
> Dream * Excel * Explore * Inspire
> Jon McAlexander
> Infrastructure Engineer
> Asst Vice President
>
> Middleware Product Engineering
> Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions
>
> 8080 Cobblestone Rd | Urbandale, IA 50322
> MAC: F4469-010
> Tel 515-988-2508 | Cell 515-988-2508
>
> jonmcalexander@wellsfargo.com
>
> Upcoming PTO: 10/30/2020, 11/6/2020, 11/13/2020, 11/20/2020, 11/27/2020, 12/2/2020, 12/4/2020, 12/11/2020, 12/18/2020, 12/28/2020, 12/29/2020, 12/30/2020, 12/31/2020
> This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
>
>> -----Original Message-----
>> From: Christopher Schultz <ch...@christopherschultz.net>
>> Sent: Wednesday, June 16, 2021 11:14 AM
>> To: users@tomcat.apache.org
>> Subject: Re: CATALINA_OPTS vs JAVA_OPTS
>>
>> Noelette,
>>
>> On 6/16/21 11:29, Noelette Stout wrote:
>>> Thanks! I was mostly trying to figure out if there was precedence or
>>> if it was additive (i.e. 2GB to tomcat itself and another 2GB to the
>>> apps). We're having some resource issues on one of our servers, so I
>>> wanted to make sure I understood how the resources were being
>> allocated.
>>
>> No additivity at all: the last one on the command-line wins. There is no heap
>> separation between Tomcat and the applications: it's one(ish) big, happy
>> heap. :)
>>
>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
>> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
>> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
>> There are many Java processes those scripts will launch that aren't actually
>> launching Tomcat. Examples include:
>>
>> 1. catalina.sh configtest
>> 2. catalina.sh stop (also shutdown.sh)
>> 3. catalina.sh version
>> 4. tool-wrapper.sh [anything]
>>
>> In all of those cases, JAVA_OPTS will be passed to the JVM.
>>
>> Do you really need a 2 gig heap to send a "shutdown" command to a running
>> server? Probably not.
>>
>> -chris
>>
>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
>> wrote:
>>>>
>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
>>>>> openjdk version "1.8.0_292"
>>>>>
>>>>>
>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
>>>> wrote:
>>>>>
>>>> Both as for the same minimum so you should get 2G at start up.  I'm
>>>> not sure which has precedency but I would be on java opt.  I don't
>>>> have a catalina env, but you can see how CATALINA_OPTS is used in
>>>> relationship with JAVA_OPTS
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
> ---------------------------------------------------------------------
> 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


RE: CATALINA_OPTS vs JAVA_OPTS

Posted by jo...@wellsfargo.com.INVALID.
Ok, so this is a really good explanation. However, when setting up in Windows as a Service, does the JAVA_OPTIONS in the Registry go in as JAVA_OPTS or CATALINA_OPTS? Is there a way to have separate CATALINA_OPTS for Tomcat Windows Services?

Thanks,

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexander@wellsfargo.com

Upcoming PTO: 10/30/2020, 11/6/2020, 11/13/2020, 11/20/2020, 11/27/2020, 12/2/2020, 12/4/2020, 12/11/2020, 12/18/2020, 12/28/2020, 12/29/2020, 12/30/2020, 12/31/2020
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

> -----Original Message-----
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Wednesday, June 16, 2021 11:14 AM
> To: users@tomcat.apache.org
> Subject: Re: CATALINA_OPTS vs JAVA_OPTS
> 
> Noelette,
> 
> On 6/16/21 11:29, Noelette Stout wrote:
> > Thanks! I was mostly trying to figure out if there was precedence or
> > if it was additive (i.e. 2GB to tomcat itself and another 2GB to the
> > apps). We're having some resource issues on one of our servers, so I
> > wanted to make sure I understood how the resources were being
> allocated.
> 
> No additivity at all: the last one on the command-line wins. There is no heap
> separation between Tomcat and the applications: it's one(ish) big, happy
> heap. :)
> 
> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
> There are many Java processes those scripts will launch that aren't actually
> launching Tomcat. Examples include:
> 
> 1. catalina.sh configtest
> 2. catalina.sh stop (also shutdown.sh)
> 3. catalina.sh version
> 4. tool-wrapper.sh [anything]
> 
> In all of those cases, JAVA_OPTS will be passed to the JVM.
> 
> Do you really need a 2 gig heap to send a "shutdown" command to a running
> server? Probably not.
> 
> -chris
> 
> > On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
> wrote:
> >
> >>
> >>
> >> On 6/16/21 9:06 AM, Noelette Stout wrote:
> >>> openjdk version "1.8.0_292"
> >>>
> >>>
> >>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
> >> wrote:
> >>>
> >>>
> >> Both as for the same minimum so you should get 2G at start up.  I'm
> >> not sure which has precedency but I would be on java opt.  I don't
> >> have a catalina env, but you can see how CATALINA_OPTS is used in
> >> relationship with JAVA_OPTS
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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


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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Noelette,

On 6/16/21 13:31, Noelette Stout wrote:
> ok, one more question for clarification :-)
> The vendor docs say this:
> "Define CATALINA_OPTS to configure the following JVM settings:
> CATALINA_OPTS=-server -Xms2048m -Xmx4g -XX:MaxMetaspaceSize=512m
> Note:If you are deploying multiple [vendor] applications to the same Tomcat
> server, -Xmx must be increased by 2g and -XX:MaxMetaspaceSize must be
> increased by 128m."
> 
> Given that they are (ostensibly, based on the above statement) JVM
> settings, would these settings be better placed under JAVA_OPTS instead of
> CATALINA_OPTS?

As others have said, no, you still want CATALINA_OPTS. I guess I wasn't 
absolutely clear before. Both CATALINA_OPTS *and* JAVA_OPTS will be used 
when launching Tomcat. Other things those scripts do will only use 
JAVA_OPTS. So you only want CATALINA_OPTS to include the things that you 
*really* want to affect Tomcat itself.

If you set JAVA_OPTS to -Xms5g then you will get a 5 GiB heap allocated 
to do nothing more than this simple CLI command:

$ echo SHUTDOWN | nc localhost:8005

CATALINA_OPTS is essentially JAVA_OPTS for when you are starting Tomcat, 
but not the other stuff (like shutting it down).

-chris

> On Wed, Jun 16, 2021 at 10:29 AM Noelette Stout <no...@isu.edu>
> wrote:
> 
>> This confirms something that I was thinking originally, which is that we
>> have no good reason to have both in setenv.sh. I'm pretty sure that these
>> were both mentioned in various pieces of documentation from the application
>> vendor. Their documentation tends to be less than stellar. Combine bad
>> documentation with app admins that are completely unfamiliar with tomcat...
>> and you get messy setups. Unfortunately, there are more of them than me, so
>> I have to have ALL of my facts straight before I go into battle.
>>
>> Thanks for this additional information. It is much appreciated.
>>
>> On Wed, Jun 16, 2021 at 10:14 AM Christopher Schultz <
>> chris@christopherschultz.net> wrote:
>>
>>> Noelette,
>>>
>>> On 6/16/21 11:29, Noelette Stout wrote:
>>>> Thanks! I was mostly trying to figure out if there was precedence or if
>>> it
>>>> was additive (i.e. 2GB to tomcat itself and another 2GB to the apps).
>>> We're
>>>> having some resource issues on one of our servers, so I wanted to make
>>> sure
>>>> I understood how the resources were being allocated.
>>>
>>> No additivity at all: the last one on the command-line wins. There is no
>>> heap separation between Tomcat and the applications: it's one(ish) big,
>>> happy heap. :)
>>>
>>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
>>> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
>>> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
>>> There are many Java processes those scripts will launch that aren't
>>> actually launching Tomcat. Examples include:
>>>
>>> 1. catalina.sh configtest
>>> 2. catalina.sh stop (also shutdown.sh)
>>> 3. catalina.sh version
>>> 4. tool-wrapper.sh [anything]
>>>
>>> In all of those cases, JAVA_OPTS will be passed to the JVM.
>>>
>>> Do you really need a 2 gig heap to send a "shutdown" command to a
>>> running server? Probably not.
>>>
>>> -chris
>>>
>>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
>>>>>> openjdk version "1.8.0_292"
>>>>>>
>>>>>>
>>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>> Both as for the same minimum so you should get 2G at start up.  I'm not
>>>>> sure which has precedency but I would be on java opt.  I don't have a
>>>>> catalina env, but you can see how CATALINA_OPTS is used in relationship
>>>>> with JAVA_OPTS
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>>
>>
>> --
>> Noelette Stout
>>
>> ITS Enterprise Applications - Application Administrator - Senior
>>
>> Business Administration Building, Rm 109L
>> 921 South 8th Ave 8037
>> Idaho State University
>> Pocatello ID 83209
>> E-mail: stounoel "at" isu "dot" edu
>> Desk: 208-282-2554
>>
> 
> 

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


RE: [Possible Spam] Re: CATALINA_OPTS vs JAVA_OPTS

Posted by "Mark A. Claassen" <MC...@ocie.net>.
While on the subject of CATALINA_OPTS.  In 9.0.46, the catalina.sh script displays these when it runs.  I have several options in the CATALINA_OPTS, which makes this pretty long.
I don't remember it being this way in the past.  I would imagine that if this was changed to be like this, there was a good reason, but it makes my startup process look broken.  Would having this go to the catalina.out file be a good solution?  Or it is critical for others that it is output to stdout?

If this is critical, should JAVA_OPTS also be displayed to stdout?
-----
(
In the setenv.sh file, we use enough options that we use line continuation to make the file more readable which makes the CATALINA_OPTS line less readable because of the whitespace.
	-Xms128M \
	-Xmx512M \
	...
)

Mark Claassen
Senior Software Engineer

Donnell Systems, Inc.
130 South Main Street
Leighton Plaza Suite 375
South Bend, IN  46601
E-mail: mailto:mclaassen@ocie.net
Voice: (574)232-3784
Fax: (574)232-4014

Disclaimer:
The opinions provided herein do not necessarily state or reflect 
those of Donnell Systems, Inc.(DSI). DSI makes no warranty for and 
assumes no legal liability or responsibility for the posting. 
-----Original Message-----
From: Noelette Stout <no...@isu.edu> 
Sent: Wednesday, June 16, 2021 1:47 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: [Possible Spam] Re: CATALINA_OPTS vs JAVA_OPTS
Importance: Low

Thanks! That clears things up a lot. I think my admins got confused and did both because there are some instructions that say to add these in JAVA_OPTS, but those instructions are specifically for Windows servers (we're on RHEL).

Thanks everyone for all the info and help.

On Wed, Jun 16, 2021 at 11:42 AM Mark Thomas <ma...@apache.org> wrote:

> On 16/06/2021 18:31, Noelette Stout wrote:
> > ok, one more question for clarification :-) The vendor docs say 
> > this:
> > "Define CATALINA_OPTS to configure the following JVM settings:
> > CATALINA_OPTS=-server -Xms2048m -Xmx4g -XX:MaxMetaspaceSize=512m 
> > Note:If you are deploying multiple [vendor] applications to the same
> Tomcat
> > server, -Xmx must be increased by 2g and -XX:MaxMetaspaceSize must 
> > be increased by 128m."
> >
> > Given that they are (ostensibly, based on the above statement) JVM 
> > settings, would these settings be better placed under JAVA_OPTS 
> > instead
> of
> > CATALINA_OPTS?
>
> No. CATALINA_OPTS.
>
> 99 times out of a 100 you want to put any JVM settings in CATALINA_OPTS.
>
> Mark
>
> >
> >
> > On Wed, Jun 16, 2021 at 10:29 AM Noelette Stout 
> > <no...@isu.edu>
> > wrote:
> >
> >> This confirms something that I was thinking originally, which is 
> >> that we have no good reason to have both in setenv.sh. I'm pretty 
> >> sure that
> these
> >> were both mentioned in various pieces of documentation from the
> application
> >> vendor. Their documentation tends to be less than stellar. Combine 
> >> bad documentation with app admins that are completely unfamiliar 
> >> with
> tomcat...
> >> and you get messy setups. Unfortunately, there are more of them 
> >> than
> me, so
> >> I have to have ALL of my facts straight before I go into battle.
> >>
> >> Thanks for this additional information. It is much appreciated.
> >>
> >> On Wed, Jun 16, 2021 at 10:14 AM Christopher Schultz < 
> >> chris@christopherschultz.net> wrote:
> >>
> >>> Noelette,
> >>>
> >>> On 6/16/21 11:29, Noelette Stout wrote:
> >>>> Thanks! I was mostly trying to figure out if there was precedence 
> >>>> or
> if
> >>> it
> >>>> was additive (i.e. 2GB to tomcat itself and another 2GB to the apps).
> >>> We're
> >>>> having some resource issues on one of our servers, so I wanted to 
> >>>> make
> >>> sure
> >>>> I understood how the resources were being allocated.
> >>>
> >>> No additivity at all: the last one on the command-line wins. There 
> >>> is
> no
> >>> heap separation between Tomcat and the applications: it's one(ish) 
> >>> big, happy heap. :)
> >>>
> >>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the 
> >>> various scripts provided by Tomcat, CATALINA_OPTS is only used 
> >>> when launching a Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
> >>> There are many Java processes those scripts will launch that 
> >>> aren't actually launching Tomcat. Examples include:
> >>>
> >>> 1. catalina.sh configtest
> >>> 2. catalina.sh stop (also shutdown.sh) 3. catalina.sh version 4. 
> >>> tool-wrapper.sh [anything]
> >>>
> >>> In all of those cases, JAVA_OPTS will be passed to the JVM.
> >>>
> >>> Do you really need a 2 gig heap to send a "shutdown" command to a 
> >>> running server? Probably not.
> >>>
> >>> -chris
> >>>
> >>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent 
> >>>> <rs...@xmission.com>
> >>> wrote:
> >>>>
> >>>>>
> >>>>>
> >>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
> >>>>>> openjdk version "1.8.0_292"
> >>>>>>
> >>>>>>
> >>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent 
> >>>>>> <rs...@xmission.com>
> >>>>> wrote:
> >>>>>>
> >>>>>>
> >>>>> Both as for the same minimum so you should get 2G at start up.  
> >>>>> I'm
> not
> >>>>> sure which has precedency but I would be on java opt.  I don't 
> >>>>> have a catalina env, but you can see how CATALINA_OPTS is used 
> >>>>> in
> relationship
> >>>>> with JAVA_OPTS
> >>>>>
> >>>>>
> >>>>> ----------------------------------------------------------------
> >>>>> ----- 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
> >>>
> >>>
> >>
> >> --
> >> Noelette Stout
> >>
> >> ITS Enterprise Applications - Application Administrator - Senior
> >>
> >> Business Administration Building, Rm 109L
> >> 921 South 8th Ave 8037
> >> Idaho State University
> >> Pocatello ID 83209
> >> E-mail: stounoel "at" isu "dot" edu
> >> Desk: 208-282-2554
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

--
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Noelette Stout <no...@isu.edu>.
Thanks! That clears things up a lot. I think my admins got confused and did
both because there are some instructions that say to add these in
JAVA_OPTS, but those instructions are specifically for Windows servers
(we're on RHEL).

Thanks everyone for all the info and help.

On Wed, Jun 16, 2021 at 11:42 AM Mark Thomas <ma...@apache.org> wrote:

> On 16/06/2021 18:31, Noelette Stout wrote:
> > ok, one more question for clarification :-)
> > The vendor docs say this:
> > "Define CATALINA_OPTS to configure the following JVM settings:
> > CATALINA_OPTS=-server -Xms2048m -Xmx4g -XX:MaxMetaspaceSize=512m
> > Note:If you are deploying multiple [vendor] applications to the same
> Tomcat
> > server, -Xmx must be increased by 2g and -XX:MaxMetaspaceSize must be
> > increased by 128m."
> >
> > Given that they are (ostensibly, based on the above statement) JVM
> > settings, would these settings be better placed under JAVA_OPTS instead
> of
> > CATALINA_OPTS?
>
> No. CATALINA_OPTS.
>
> 99 times out of a 100 you want to put any JVM settings in CATALINA_OPTS.
>
> Mark
>
> >
> >
> > On Wed, Jun 16, 2021 at 10:29 AM Noelette Stout <no...@isu.edu>
> > wrote:
> >
> >> This confirms something that I was thinking originally, which is that we
> >> have no good reason to have both in setenv.sh. I'm pretty sure that
> these
> >> were both mentioned in various pieces of documentation from the
> application
> >> vendor. Their documentation tends to be less than stellar. Combine bad
> >> documentation with app admins that are completely unfamiliar with
> tomcat...
> >> and you get messy setups. Unfortunately, there are more of them than
> me, so
> >> I have to have ALL of my facts straight before I go into battle.
> >>
> >> Thanks for this additional information. It is much appreciated.
> >>
> >> On Wed, Jun 16, 2021 at 10:14 AM Christopher Schultz <
> >> chris@christopherschultz.net> wrote:
> >>
> >>> Noelette,
> >>>
> >>> On 6/16/21 11:29, Noelette Stout wrote:
> >>>> Thanks! I was mostly trying to figure out if there was precedence or
> if
> >>> it
> >>>> was additive (i.e. 2GB to tomcat itself and another 2GB to the apps).
> >>> We're
> >>>> having some resource issues on one of our servers, so I wanted to make
> >>> sure
> >>>> I understood how the resources were being allocated.
> >>>
> >>> No additivity at all: the last one on the command-line wins. There is
> no
> >>> heap separation between Tomcat and the applications: it's one(ish) big,
> >>> happy heap. :)
> >>>
> >>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
> >>> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
> >>> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
> >>> There are many Java processes those scripts will launch that aren't
> >>> actually launching Tomcat. Examples include:
> >>>
> >>> 1. catalina.sh configtest
> >>> 2. catalina.sh stop (also shutdown.sh)
> >>> 3. catalina.sh version
> >>> 4. tool-wrapper.sh [anything]
> >>>
> >>> In all of those cases, JAVA_OPTS will be passed to the JVM.
> >>>
> >>> Do you really need a 2 gig heap to send a "shutdown" command to a
> >>> running server? Probably not.
> >>>
> >>> -chris
> >>>
> >>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
> >>> wrote:
> >>>>
> >>>>>
> >>>>>
> >>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
> >>>>>> openjdk version "1.8.0_292"
> >>>>>>
> >>>>>>
> >>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
> >>>>> wrote:
> >>>>>>
> >>>>>>
> >>>>> Both as for the same minimum so you should get 2G at start up.  I'm
> not
> >>>>> sure which has precedency but I would be on java opt.  I don't have a
> >>>>> catalina env, but you can see how CATALINA_OPTS is used in
> relationship
> >>>>> with JAVA_OPTS
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> 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
> >>>
> >>>
> >>
> >> --
> >> Noelette Stout
> >>
> >> ITS Enterprise Applications - Application Administrator - Senior
> >>
> >> Business Administration Building, Rm 109L
> >> 921 South 8th Ave 8037
> >> Idaho State University
> >> Pocatello ID 83209
> >> E-mail: stounoel "at" isu "dot" edu
> >> Desk: 208-282-2554
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Mark Thomas <ma...@apache.org>.
On 16/06/2021 18:31, Noelette Stout wrote:
> ok, one more question for clarification :-)
> The vendor docs say this:
> "Define CATALINA_OPTS to configure the following JVM settings:
> CATALINA_OPTS=-server -Xms2048m -Xmx4g -XX:MaxMetaspaceSize=512m
> Note:If you are deploying multiple [vendor] applications to the same Tomcat
> server, -Xmx must be increased by 2g and -XX:MaxMetaspaceSize must be
> increased by 128m."
> 
> Given that they are (ostensibly, based on the above statement) JVM
> settings, would these settings be better placed under JAVA_OPTS instead of
> CATALINA_OPTS?

No. CATALINA_OPTS.

99 times out of a 100 you want to put any JVM settings in CATALINA_OPTS.

Mark

> 
> 
> On Wed, Jun 16, 2021 at 10:29 AM Noelette Stout <no...@isu.edu>
> wrote:
> 
>> This confirms something that I was thinking originally, which is that we
>> have no good reason to have both in setenv.sh. I'm pretty sure that these
>> were both mentioned in various pieces of documentation from the application
>> vendor. Their documentation tends to be less than stellar. Combine bad
>> documentation with app admins that are completely unfamiliar with tomcat...
>> and you get messy setups. Unfortunately, there are more of them than me, so
>> I have to have ALL of my facts straight before I go into battle.
>>
>> Thanks for this additional information. It is much appreciated.
>>
>> On Wed, Jun 16, 2021 at 10:14 AM Christopher Schultz <
>> chris@christopherschultz.net> wrote:
>>
>>> Noelette,
>>>
>>> On 6/16/21 11:29, Noelette Stout wrote:
>>>> Thanks! I was mostly trying to figure out if there was precedence or if
>>> it
>>>> was additive (i.e. 2GB to tomcat itself and another 2GB to the apps).
>>> We're
>>>> having some resource issues on one of our servers, so I wanted to make
>>> sure
>>>> I understood how the resources were being allocated.
>>>
>>> No additivity at all: the last one on the command-line wins. There is no
>>> heap separation between Tomcat and the applications: it's one(ish) big,
>>> happy heap. :)
>>>
>>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
>>> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
>>> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
>>> There are many Java processes those scripts will launch that aren't
>>> actually launching Tomcat. Examples include:
>>>
>>> 1. catalina.sh configtest
>>> 2. catalina.sh stop (also shutdown.sh)
>>> 3. catalina.sh version
>>> 4. tool-wrapper.sh [anything]
>>>
>>> In all of those cases, JAVA_OPTS will be passed to the JVM.
>>>
>>> Do you really need a 2 gig heap to send a "shutdown" command to a
>>> running server? Probably not.
>>>
>>> -chris
>>>
>>>> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On 6/16/21 9:06 AM, Noelette Stout wrote:
>>>>>> openjdk version "1.8.0_292"
>>>>>>
>>>>>>
>>>>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>> Both as for the same minimum so you should get 2G at start up.  I'm not
>>>>> sure which has precedency but I would be on java opt.  I don't have a
>>>>> catalina env, but you can see how CATALINA_OPTS is used in relationship
>>>>> with JAVA_OPTS
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>>
>>
>> --
>> Noelette Stout
>>
>> ITS Enterprise Applications - Application Administrator - Senior
>>
>> Business Administration Building, Rm 109L
>> 921 South 8th Ave 8037
>> Idaho State University
>> Pocatello ID 83209
>> E-mail: stounoel "at" isu "dot" edu
>> Desk: 208-282-2554
>>
> 
> 


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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Noelette Stout <no...@isu.edu>.
ok, one more question for clarification :-)
The vendor docs say this:
"Define CATALINA_OPTS to configure the following JVM settings:
CATALINA_OPTS=-server -Xms2048m -Xmx4g -XX:MaxMetaspaceSize=512m
Note:If you are deploying multiple [vendor] applications to the same Tomcat
server, -Xmx must be increased by 2g and -XX:MaxMetaspaceSize must be
increased by 128m."

Given that they are (ostensibly, based on the above statement) JVM
settings, would these settings be better placed under JAVA_OPTS instead of
CATALINA_OPTS?


On Wed, Jun 16, 2021 at 10:29 AM Noelette Stout <no...@isu.edu>
wrote:

> This confirms something that I was thinking originally, which is that we
> have no good reason to have both in setenv.sh. I'm pretty sure that these
> were both mentioned in various pieces of documentation from the application
> vendor. Their documentation tends to be less than stellar. Combine bad
> documentation with app admins that are completely unfamiliar with tomcat...
> and you get messy setups. Unfortunately, there are more of them than me, so
> I have to have ALL of my facts straight before I go into battle.
>
> Thanks for this additional information. It is much appreciated.
>
> On Wed, Jun 16, 2021 at 10:14 AM Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> Noelette,
>>
>> On 6/16/21 11:29, Noelette Stout wrote:
>> > Thanks! I was mostly trying to figure out if there was precedence or if
>> it
>> > was additive (i.e. 2GB to tomcat itself and another 2GB to the apps).
>> We're
>> > having some resource issues on one of our servers, so I wanted to make
>> sure
>> > I understood how the resources were being allocated.
>>
>> No additivity at all: the last one on the command-line wins. There is no
>> heap separation between Tomcat and the applications: it's one(ish) big,
>> happy heap. :)
>>
>> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
>> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
>> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
>> There are many Java processes those scripts will launch that aren't
>> actually launching Tomcat. Examples include:
>>
>> 1. catalina.sh configtest
>> 2. catalina.sh stop (also shutdown.sh)
>> 3. catalina.sh version
>> 4. tool-wrapper.sh [anything]
>>
>> In all of those cases, JAVA_OPTS will be passed to the JVM.
>>
>> Do you really need a 2 gig heap to send a "shutdown" command to a
>> running server? Probably not.
>>
>> -chris
>>
>> > On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
>> wrote:
>> >
>> >>
>> >>
>> >> On 6/16/21 9:06 AM, Noelette Stout wrote:
>> >>> openjdk version "1.8.0_292"
>> >>>
>> >>>
>> >>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
>> >> wrote:
>> >>>
>> >>>
>> >> Both as for the same minimum so you should get 2G at start up.  I'm not
>> >> sure which has precedency but I would be on java opt.  I don't have a
>> >> catalina env, but you can see how CATALINA_OPTS is used in relationship
>> >> with JAVA_OPTS
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>
> --
> Noelette Stout
>
> ITS Enterprise Applications - Application Administrator - Senior
>
> Business Administration Building, Rm 109L
> 921 South 8th Ave 8037
> Idaho State University
> Pocatello ID 83209
> E-mail: stounoel "at" isu "dot" edu
> Desk: 208-282-2554
>


-- 
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Noelette Stout <no...@isu.edu>.
This confirms something that I was thinking originally, which is that we
have no good reason to have both in setenv.sh. I'm pretty sure that these
were both mentioned in various pieces of documentation from the application
vendor. Their documentation tends to be less than stellar. Combine bad
documentation with app admins that are completely unfamiliar with tomcat...
and you get messy setups. Unfortunately, there are more of them than me, so
I have to have ALL of my facts straight before I go into battle.

Thanks for this additional information. It is much appreciated.

On Wed, Jun 16, 2021 at 10:14 AM Christopher Schultz <
chris@christopherschultz.net> wrote:

> Noelette,
>
> On 6/16/21 11:29, Noelette Stout wrote:
> > Thanks! I was mostly trying to figure out if there was precedence or if
> it
> > was additive (i.e. 2GB to tomcat itself and another 2GB to the apps).
> We're
> > having some resource issues on one of our servers, so I wanted to make
> sure
> > I understood how the resources were being allocated.
>
> No additivity at all: the last one on the command-line wins. There is no
> heap separation between Tomcat and the applications: it's one(ish) big,
> happy heap. :)
>
> A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various
> scripts provided by Tomcat, CATALINA_OPTS is only used when launching a
> Tomcat instance. JAVA_OPTS is used when launching *any* Java process.
> There are many Java processes those scripts will launch that aren't
> actually launching Tomcat. Examples include:
>
> 1. catalina.sh configtest
> 2. catalina.sh stop (also shutdown.sh)
> 3. catalina.sh version
> 4. tool-wrapper.sh [anything]
>
> In all of those cases, JAVA_OPTS will be passed to the JVM.
>
> Do you really need a 2 gig heap to send a "shutdown" command to a
> running server? Probably not.
>
> -chris
>
> > On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com>
> wrote:
> >
> >>
> >>
> >> On 6/16/21 9:06 AM, Noelette Stout wrote:
> >>> openjdk version "1.8.0_292"
> >>>
> >>>
> >>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
> >> wrote:
> >>>
> >>>
> >> Both as for the same minimum so you should get 2G at start up.  I'm not
> >> sure which has precedency but I would be on java opt.  I don't have a
> >> catalina env, but you can see how CATALINA_OPTS is used in relationship
> >> with JAVA_OPTS
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>

-- 
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Noelette,

On 6/16/21 11:29, Noelette Stout wrote:
> Thanks! I was mostly trying to figure out if there was precedence or if it
> was additive (i.e. 2GB to tomcat itself and another 2GB to the apps). We're
> having some resource issues on one of our servers, so I wanted to make sure
> I understood how the resources were being allocated.

No additivity at all: the last one on the command-line wins. There is no 
heap separation between Tomcat and the applications: it's one(ish) big, 
happy heap. :)

A note about CATALINA_OPTS versus JAVA_OPTS: when you use the various 
scripts provided by Tomcat, CATALINA_OPTS is only used when launching a 
Tomcat instance. JAVA_OPTS is used when launching *any* Java process. 
There are many Java processes those scripts will launch that aren't 
actually launching Tomcat. Examples include:

1. catalina.sh configtest
2. catalina.sh stop (also shutdown.sh)
3. catalina.sh version
4. tool-wrapper.sh [anything]

In all of those cases, JAVA_OPTS will be passed to the JVM.

Do you really need a 2 gig heap to send a "shutdown" command to a 
running server? Probably not.

-chris

> On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com> wrote:
> 
>>
>>
>> On 6/16/21 9:06 AM, Noelette Stout wrote:
>>> openjdk version "1.8.0_292"
>>>
>>>
>>> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
>> wrote:
>>>
>>>
>> Both as for the same minimum so you should get 2G at start up.  I'm not
>> sure which has precedency but I would be on java opt.  I don't have a
>> catalina env, but you can see how CATALINA_OPTS is used in relationship
>> with JAVA_OPTS
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Noelette Stout <no...@isu.edu>.
Thanks! I was mostly trying to figure out if there was precedence or if it
was additive (i.e. 2GB to tomcat itself and another 2GB to the apps). We're
having some resource issues on one of our servers, so I wanted to make sure
I understood how the resources were being allocated.

On Wed, Jun 16, 2021 at 9:17 AM Rob Sargent <rs...@xmission.com> wrote:

>
>
> On 6/16/21 9:06 AM, Noelette Stout wrote:
> > openjdk version "1.8.0_292"
> >
> >
> > On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com>
> wrote:
> >
> >
> Both as for the same minimum so you should get 2G at start up.  I'm not
> sure which has precedency but I would be on java opt.  I don't have a
> catalina env, but you can see how CATALINA_OPTS is used in relationship
> with JAVA_OPTS
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Rob Sargent <rs...@xmission.com>.

On 6/16/21 9:06 AM, Noelette Stout wrote:
> openjdk version "1.8.0_292"
>
>
> On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com> wrote:
>
>
Both as for the same minimum so you should get 2G at start up.  I'm not 
sure which has precedency but I would be on java opt.  I don't have a 
catalina env, but you can see how CATALINA_OPTS is used in relationship 
with JAVA_OPTS


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


Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Noelette Stout <no...@isu.edu>.
openjdk version "1.8.0_292"


On Wed, Jun 16, 2021 at 9:04 AM Rob Sargent <rs...@xmission.com> wrote:

>
>
> > On Jun 16, 2021, at 8:36 AM, Noelette Stout <no...@isu.edu>
> wrote:
> >
> > If I have a setenv.sh file that contains:
> > CATALINA_OPTS="-server -Xms2048m -Xmx5g"
> > JAVA_OPTS="... -Xms2048m -Xmx4g .."
> >
> > How much memory is actually being allocated to tomcat and the
> applications
> > it is serving up?
> >
> > --
> > Noelette Stout
>
> Which version of Java?
> >
> > ITS Enterprise Applications - Application Administrator - Senior
> >
> > Business Administration Building, Rm 109L
> > 921 South 8th Ave 8037
> > Idaho State University
> > Pocatello ID 83209
> > E-mail: stounoel "at" isu "dot" edu
> > Desk: 208-282-2554
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Noelette Stout

ITS Enterprise Applications - Application Administrator - Senior

Business Administration Building, Rm 109L
921 South 8th Ave 8037
Idaho State University
Pocatello ID 83209
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: CATALINA_OPTS vs JAVA_OPTS

Posted by Rob Sargent <rs...@xmission.com>.

> On Jun 16, 2021, at 8:36 AM, Noelette Stout <no...@isu.edu> wrote:
> 
> If I have a setenv.sh file that contains:
> CATALINA_OPTS="-server -Xms2048m -Xmx5g"
> JAVA_OPTS="... -Xms2048m -Xmx4g .."
> 
> How much memory is actually being allocated to tomcat and the applications
> it is serving up?
> 
> -- 
> Noelette Stout

Which version of Java?
> 
> ITS Enterprise Applications - Application Administrator - Senior
> 
> Business Administration Building, Rm 109L
> 921 South 8th Ave 8037
> Idaho State University
> Pocatello ID 83209
> E-mail: stounoel "at" isu "dot" edu
> Desk: 208-282-2554

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