You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kevin Jenkins <ra...@jenkinssoftware.com> on 2013/03/31 19:20:31 UTC

Tomcat how to set -Xms and -Xmx

If I run tomcat7w.exe (windows) there is a tab where I can set the initial
and maximum memory pool to 2560. However, I don't want to use tomcat7w.exe,
I just want to run the  batch file manually (startup.bat). However, I can't
figure out how to set these memory pool values for startup.bat to use.

I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat which
contains
SET JAVA_OPTS=-Xms2560 -Xmx2560

However, it doesn't work. If I run startup.bat, instead of launching the
webserver it just prints some messages and that's it. No webserver is
started.

C:\apache-tomcat-7.0.37\bin>startup.bat
Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
Using CLASSPATH:
"C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
at-7.0.37\bin\tomcat-juli.jar"
C:\apache-tomcat-7.0.37\bin>

Re: Tomcat how to set -Xms and -Xmx

Posted by Neven Cvetkovic <ne...@gmail.com>.
On Sun, Mar 31, 2013 at 4:54 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com]
> > Subject: RE: Tomcat how to set -Xms and -Xmx
>
> > Add a "call setenv.bat" (with path as necessary) to startup.bat, or just
> > add the relevant SET statements directly to startup.bat.
>
> That's completely unnecessary, and inappropriate.  The call to setenv.bat
> is automatic.  Do not change the standard startup.bat and catalina.bat
> scripts.


+1 agreed with Charles! You should not need to change the standard
startup.bat and catalina.bat scripts, ever.

All customizations should be done through options defined in
%CATALINA_HOME%\bin\setenv.bat (or %CATALINA_BASE%\bin\setenv.bat) script.
The setenv.bat script doesn't exist by default, but catalina.bat checks for
existence of the script and calls the script if it exists, see the
following section of the default catalina.bat script:

--- catalina.bat ---
...
rem Get standard environment variables
if not exist "%CATALINA_BASE%\bin\setenv.bat" goto checkSetenvHome
call "%CATALINA_BASE%\bin\setenv.bat"
goto setenvDone
:checkSetenvHome
if exist "%CATALINA_HOME%\bin\setenv.bat" call
"%CATALINA_HOME%\bin\setenv.bat"
:setenvDone
...
--------------------

So, the intention is that you do all customizations are isolated in the
'setenv.bat' script, and they are separated from the standard scripts
(startup.bat, shutdown.bat, catalina.bat) - which makes the Tomcat version
updates very easy! No back-porting of the catalina.bat or startup.bat to
fit your new version of Tomcat.

There are two options that you can use to set the JVM memory options:
CATALINA_OPTS (for "start" and "run")
JAVA_OPTS (for "start", "stop" and "run")

I suggest you use CATALINA_OPTS for setting up memory, instead of using
JAVA_OPTS. The reason is that we are setting Tomcat(Catalina) options, and
we don't want to override JAVA_OPTS for some other Java applications.

Here's an example setenv.bat script:

--- setenv.bat ---
ECHO Executing setenv.bat script.
ECHO.
ECHO.
ECHO.
SET CATALINA_OPTS=-Xms256M -Xmx512M
------------------

Of course, you can remove first four lines after you have successfully
tested your startup script. I would suggest you start your script with
"catalina.bat run", so you can see the output of the startup command. In
the end, startup.bat is really just "catalina.bat start". Also, check the
process manager and see the actual command line that stared the java.exe
process.

Hope that helps!
Cheers!

RE: Tomcat how to set -Xms and -Xmx

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com] 
> Subject: RE: Tomcat how to set -Xms and -Xmx

> Add a "call setenv.bat" (with path as necessary) to startup.bat, or just 
> add the relevant SET statements directly to startup.bat.

That's completely unnecessary, and inappropriate.  The call to setenv.bat is automatic.  Do not change the standard startup.bat and catalina.bat scripts.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


RE: Tomcat how to set -Xms and -Xmx

Posted by "Harris, Jeffrey E." <Je...@ManTech.com>.

> -----Original Message-----
> From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> Sent: Sunday, March 31, 2013 2:09 PM
> To: Tomcat Users List
> Subject: Re: Tomcat how to set -Xms and -Xmx
>
> Actually that does not work, sorry for the too-soon post. If I modify
> startup.bat as follows:
> SET JAVA_OPTS=-Xms2560 -Xmx2560
> call "%EXECUTABLE%" start %CMD_LINE_ARGS%
>
> It does not start the webserver, it just prints some messages and does
> nothing else
>
> C:\apache-tomcat-7.0.39\bin>startup.bat
> Using CATALINA_BASE:   "C:\apache-tomcat-7.0.39"
> Using CATALINA_HOME:   "C:\apache-tomcat-7.0.39"
> Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.39\temp"
> Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> Using CLASSPATH:
> "C:\apache-tomcat-7.0.39\bin\bootstrap.jar;C:\apache-tomc
> at-7.0.39\bin\tomcat-juli.jar"
>
>
> On Sun, Mar 31, 2013 at 11:06 AM, Kevin Jenkins
> <ra...@jenkinssoftware.com>wrote:
>
> > I did this:
> >
> > SET JAVA_OPTS=-Xms2560 -Xmx2560
> > call "%EXECUTABLE%" start %CMD_LINE_ARGS%
> >
> >
> > On Sun, Mar 31, 2013 at 10:34 AM, Harris, Jeffrey E. <
> > Jeffrey.Harris@mantech.com> wrote:
> >
> >>
> >>
> >> > -----Original Message-----
> >> > From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com]
> >> > Sent: Sunday, March 31, 2013 1:32 PM
> >> > To: Tomcat Users List
> >> > Subject: RE: Tomcat how to set -Xms and -Xmx
> >> >
> >> > > -----Original Message-----
> >> > > From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> >> > > Sent: Sunday, March 31, 2013 1:21 PM
> >> > > To: Tomcat Users List
> >> > > Subject: Tomcat how to set -Xms and -Xmx
> >> > >
> >> > > If I run tomcat7w.exe (windows) there is a tab where I can set
> >> > > the initial and maximum memory pool to 2560. However, I don't
> >> > > want to use tomcat7w.exe, I just want to run the  batch file
> >> > > manually (startup.bat). However, I can't figure out how to set
> >> > > these memory pool values for startup.bat to use.
> >> > >
> >> > > I read somewhere to create C:\apache-tomcat-
> 7.0.37\bin\setenv.bat
> >> > > which contains SET JAVA_OPTS=-Xms2560 -Xmx2560
> >> > >
> >> > > However, it doesn't work. If I run startup.bat, instead of
> >> > > launching the webserver it just prints some messages and that's
> >> > > it. No
> >> > webserver
> >> > > is started.
> >> > >
> >> > > C:\apache-tomcat-7.0.37\bin>startup.bat
> >> > > Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
> >> > > Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
> >> > > Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
> >> > > Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> >> > > Using CLASSPATH:
> >> > > "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
> >> > > at-7.0.37\bin\tomcat-juli.jar"
> >> > > C:\apache-tomcat-7.0.37\bin>
> >> >
> >> > Add a "call setenv.bat" (with path as necessary) to startup.bat,
> or
> >> > just add the relevant SET statements directly to startup.bat.
> >> >
> >> > Jeffrey Harris
> >> >
> >> >
> >> > This e-mail and any attachments are intended only for the use of
> >> > the
> >> > addressee(s) named herein and may contain proprietary information.
> >> > If you are not the intended recipient of this e-mail or believe
> >> > that you received this email in error, please take immediate
> action
> >> > to notify the sender of the apparent error by reply e-mail;
> >> > permanently delete the e-mail and any attachments from your
> >> > computer; and do not disseminate, distribute, use, or copy this
> message and any attachments.
> >> >
> >> > ------------------------------------------------------------------
> -
> >> > -- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> > For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >> I just realized you do not want a "Call" in the startup.bat.  Just
> >> add the setenv.bat line before the Tomcat startup line, or add the
> >> SET statements before the Tomcat startup line.
> >>
> >> Jeffrey Harris
> >>
> >> This e-mail and any attachments are intended only for the use of the
> >> addressee(s) named herein and may contain proprietary information.
> If
> >> you are not the intended recipient of this e-mail or believe that
> you
> >> received this email in error, please take immediate action to notify
> >> the sender of the apparent error by reply e-mail; permanently delete
> >> the e-mail and any attachments from your computer; and do not
> >> disseminate, distribute, use, or copy this message and any
> attachments.
> >>
> >> --------------------------------------------------------------------
> -
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >

Look in the Tomcat logs for errors as to why Tomcat is not starting.  If
there were existing JAVA_OPTS settings that need to be kept (which could
be preventing Tomcat from starting), use the following syntax:

Set JAVA_OPTS=%JAVA_OPTS% -Xms2560 -Xmx2560

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

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


Re: Tomcat how to set -Xms and -Xmx

Posted by Kevin Jenkins <ra...@jenkinssoftware.com>.
Actually that does not work, sorry for the too-soon post. If I modify
startup.bat as follows:
SET JAVA_OPTS=-Xms2560 -Xmx2560
call "%EXECUTABLE%" start %CMD_LINE_ARGS%

It does not start the webserver, it just prints some messages and does
nothing else

C:\apache-tomcat-7.0.39\bin>startup.bat
Using CATALINA_BASE:   "C:\apache-tomcat-7.0.39"
Using CATALINA_HOME:   "C:\apache-tomcat-7.0.39"
Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.39\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
Using CLASSPATH:
"C:\apache-tomcat-7.0.39\bin\bootstrap.jar;C:\apache-tomc
at-7.0.39\bin\tomcat-juli.jar"


On Sun, Mar 31, 2013 at 11:06 AM, Kevin Jenkins
<ra...@jenkinssoftware.com>wrote:

> I did this:
>
> SET JAVA_OPTS=-Xms2560 -Xmx2560
> call "%EXECUTABLE%" start %CMD_LINE_ARGS%
>
>
> On Sun, Mar 31, 2013 at 10:34 AM, Harris, Jeffrey E. <
> Jeffrey.Harris@mantech.com> wrote:
>
>>
>>
>> > -----Original Message-----
>> > From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com]
>> > Sent: Sunday, March 31, 2013 1:32 PM
>> > To: Tomcat Users List
>> > Subject: RE: Tomcat how to set -Xms and -Xmx
>> >
>> > > -----Original Message-----
>> > > From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
>> > > Sent: Sunday, March 31, 2013 1:21 PM
>> > > To: Tomcat Users List
>> > > Subject: Tomcat how to set -Xms and -Xmx
>> > >
>> > > If I run tomcat7w.exe (windows) there is a tab where I can set the
>> > > initial and maximum memory pool to 2560. However, I don't want to use
>> > > tomcat7w.exe, I just want to run the  batch file manually
>> > > (startup.bat). However, I can't figure out how to set these memory
>> > > pool values for startup.bat to use.
>> > >
>> > > I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat
>> > > which contains SET JAVA_OPTS=-Xms2560 -Xmx2560
>> > >
>> > > However, it doesn't work. If I run startup.bat, instead of launching
>> > > the webserver it just prints some messages and that's it. No
>> > webserver
>> > > is started.
>> > >
>> > > C:\apache-tomcat-7.0.37\bin>startup.bat
>> > > Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
>> > > Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
>> > > Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
>> > > Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
>> > > Using CLASSPATH:
>> > > "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
>> > > at-7.0.37\bin\tomcat-juli.jar"
>> > > C:\apache-tomcat-7.0.37\bin>
>> >
>> > Add a "call setenv.bat" (with path as necessary) to startup.bat, or
>> > just add the relevant SET statements directly to startup.bat.
>> >
>> > Jeffrey Harris
>> >
>> >
>> > This e-mail and any attachments are intended only for the use of the
>> > addressee(s) named herein and may contain proprietary information. If
>> > you are not the intended recipient of this e-mail or believe that you
>> > received this email in error, please take immediate action to notify
>> > the sender of the apparent error by reply e-mail; permanently delete
>> > the e-mail and any attachments from your computer; and do not
>> > disseminate, distribute, use, or copy this message and any attachments.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>>
>> I just realized you do not want a "Call" in the startup.bat.  Just add
>> the setenv.bat
>> line before the Tomcat startup line, or add the SET statements before the
>> Tomcat startup
>> line.
>>
>> Jeffrey Harris
>>
>> This e-mail and any attachments are intended only for the use of the
>> addressee(s) named herein and may contain proprietary information. If you
>> are not the intended recipient of this e-mail or believe that you received
>> this email in error, please take immediate action to notify the sender of
>> the apparent error by reply e-mail; permanently delete the e-mail and any
>> attachments from your computer; and do not disseminate, distribute, use, or
>> copy this message and any attachments.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

RE: Tomcat how to set -Xms and -Xmx

Posted by "Harris, Jeffrey E." <Je...@ManTech.com>.

> -----Original Message-----
> From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> Sent: Sunday, March 31, 2013 2:06 PM
> To: Tomcat Users List
> Subject: Re: Tomcat how to set -Xms and -Xmx
>
> I did this:
>
> SET JAVA_OPTS=-Xms2560 -Xmx2560
> call "%EXECUTABLE%" start %CMD_LINE_ARGS%
>
>
> On Sun, Mar 31, 2013 at 10:34 AM, Harris, Jeffrey E. <
> Jeffrey.Harris@mantech.com> wrote:
>
> >
> >
> > > -----Original Message-----
> > > From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com]
> > > Sent: Sunday, March 31, 2013 1:32 PM
> > > To: Tomcat Users List
> > > Subject: RE: Tomcat how to set -Xms and -Xmx
> > >
> > > > -----Original Message-----
> > > > From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> > > > Sent: Sunday, March 31, 2013 1:21 PM
> > > > To: Tomcat Users List
> > > > Subject: Tomcat how to set -Xms and -Xmx
> > > >
> > > > If I run tomcat7w.exe (windows) there is a tab where I can set
> the
> > > > initial and maximum memory pool to 2560. However, I don't want to
> > > > use tomcat7w.exe, I just want to run the  batch file manually
> > > > (startup.bat). However, I can't figure out how to set these
> memory
> > > > pool values for startup.bat to use.
> > > >
> > > > I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat
> > > > which contains SET JAVA_OPTS=-Xms2560 -Xmx2560
> > > >
> > > > However, it doesn't work. If I run startup.bat, instead of
> > > > launching the webserver it just prints some messages and that's
> > > > it. No
> > > webserver
> > > > is started.
> > > >
> > > > C:\apache-tomcat-7.0.37\bin>startup.bat
> > > > Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
> > > > Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
> > > > Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
> > > > Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> > > > Using CLASSPATH:
> > > > "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
> > > > at-7.0.37\bin\tomcat-juli.jar"
> > > > C:\apache-tomcat-7.0.37\bin>
> > >
> > > Add a "call setenv.bat" (with path as necessary) to startup.bat, or
> > > just add the relevant SET statements directly to startup.bat.
> > >
> > > Jeffrey Harris
> > >
> > >
> > > This e-mail and any attachments are intended only for the use of
> the
> > > addressee(s) named herein and may contain proprietary information.
> > > If you are not the intended recipient of this e-mail or believe
> that
> > > you received this email in error, please take immediate action to
> > > notify the sender of the apparent error by reply e-mail;
> permanently
> > > delete the e-mail and any attachments from your computer; and do
> not
> > > disseminate, distribute, use, or copy this message and any
> attachments.
> > >
> > > -------------------------------------------------------------------
> -
> > > - To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> > I just realized you do not want a "Call" in the startup.bat.  Just
> add
> > the setenv.bat line before the Tomcat startup line, or add the SET
> > statements before the Tomcat startup line.
> >
> > Jeffrey Harris
> >
> > This e-mail and any attachments are intended only for the use of the
> > addressee(s) named herein and may contain proprietary information. If
> > you are not the intended recipient of this e-mail or believe that you
> > received this email in error, please take immediate action to notify
> > the sender of the apparent error by reply e-mail; permanently delete
> > the e-mail and any attachments from your computer; and do not
> > disseminate, distribute, use, or copy this message and any
> attachments.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >

That should be fine.  Did it increase the memory size for you?  If not,
use the CATALINA_OPTS as suggested in another post.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

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


Re: Tomcat how to set -Xms and -Xmx

Posted by Kevin Jenkins <ra...@jenkinssoftware.com>.
I did this:

SET JAVA_OPTS=-Xms2560 -Xmx2560
call "%EXECUTABLE%" start %CMD_LINE_ARGS%


On Sun, Mar 31, 2013 at 10:34 AM, Harris, Jeffrey E. <
Jeffrey.Harris@mantech.com> wrote:

>
>
> > -----Original Message-----
> > From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com]
> > Sent: Sunday, March 31, 2013 1:32 PM
> > To: Tomcat Users List
> > Subject: RE: Tomcat how to set -Xms and -Xmx
> >
> > > -----Original Message-----
> > > From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> > > Sent: Sunday, March 31, 2013 1:21 PM
> > > To: Tomcat Users List
> > > Subject: Tomcat how to set -Xms and -Xmx
> > >
> > > If I run tomcat7w.exe (windows) there is a tab where I can set the
> > > initial and maximum memory pool to 2560. However, I don't want to use
> > > tomcat7w.exe, I just want to run the  batch file manually
> > > (startup.bat). However, I can't figure out how to set these memory
> > > pool values for startup.bat to use.
> > >
> > > I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat
> > > which contains SET JAVA_OPTS=-Xms2560 -Xmx2560
> > >
> > > However, it doesn't work. If I run startup.bat, instead of launching
> > > the webserver it just prints some messages and that's it. No
> > webserver
> > > is started.
> > >
> > > C:\apache-tomcat-7.0.37\bin>startup.bat
> > > Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
> > > Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
> > > Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
> > > Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> > > Using CLASSPATH:
> > > "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
> > > at-7.0.37\bin\tomcat-juli.jar"
> > > C:\apache-tomcat-7.0.37\bin>
> >
> > Add a "call setenv.bat" (with path as necessary) to startup.bat, or
> > just add the relevant SET statements directly to startup.bat.
> >
> > Jeffrey Harris
> >
> >
> > This e-mail and any attachments are intended only for the use of the
> > addressee(s) named herein and may contain proprietary information. If
> > you are not the intended recipient of this e-mail or believe that you
> > received this email in error, please take immediate action to notify
> > the sender of the apparent error by reply e-mail; permanently delete
> > the e-mail and any attachments from your computer; and do not
> > disseminate, distribute, use, or copy this message and any attachments.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> I just realized you do not want a "Call" in the startup.bat.  Just add the
> setenv.bat
> line before the Tomcat startup line, or add the SET statements before the
> Tomcat startup
> line.
>
> Jeffrey Harris
>
> This e-mail and any attachments are intended only for the use of the
> addressee(s) named herein and may contain proprietary information. If you
> are not the intended recipient of this e-mail or believe that you received
> this email in error, please take immediate action to notify the sender of
> the apparent error by reply e-mail; permanently delete the e-mail and any
> attachments from your computer; and do not disseminate, distribute, use, or
> copy this message and any attachments.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Tomcat how to set -Xms and -Xmx

Posted by "Harris, Jeffrey E." <Je...@ManTech.com>.

> -----Original Message-----
> From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@ManTech.com]
> Sent: Sunday, March 31, 2013 1:32 PM
> To: Tomcat Users List
> Subject: RE: Tomcat how to set -Xms and -Xmx
>
> > -----Original Message-----
> > From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> > Sent: Sunday, March 31, 2013 1:21 PM
> > To: Tomcat Users List
> > Subject: Tomcat how to set -Xms and -Xmx
> >
> > If I run tomcat7w.exe (windows) there is a tab where I can set the
> > initial and maximum memory pool to 2560. However, I don't want to use
> > tomcat7w.exe, I just want to run the  batch file manually
> > (startup.bat). However, I can't figure out how to set these memory
> > pool values for startup.bat to use.
> >
> > I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat
> > which contains SET JAVA_OPTS=-Xms2560 -Xmx2560
> >
> > However, it doesn't work. If I run startup.bat, instead of launching
> > the webserver it just prints some messages and that's it. No
> webserver
> > is started.
> >
> > C:\apache-tomcat-7.0.37\bin>startup.bat
> > Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
> > Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
> > Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
> > Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> > Using CLASSPATH:
> > "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
> > at-7.0.37\bin\tomcat-juli.jar"
> > C:\apache-tomcat-7.0.37\bin>
>
> Add a "call setenv.bat" (with path as necessary) to startup.bat, or
> just add the relevant SET statements directly to startup.bat.
>
> Jeffrey Harris
>
>
> This e-mail and any attachments are intended only for the use of the
> addressee(s) named herein and may contain proprietary information. If
> you are not the intended recipient of this e-mail or believe that you
> received this email in error, please take immediate action to notify
> the sender of the apparent error by reply e-mail; permanently delete
> the e-mail and any attachments from your computer; and do not
> disseminate, distribute, use, or copy this message and any attachments.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

I just realized you do not want a "Call" in the startup.bat.  Just add the setenv.bat
line before the Tomcat startup line, or add the SET statements before the Tomcat startup
line.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

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


Re: Tomcat how to set -Xms and -Xmx

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jeffrey,

On 3/31/13 1:32 PM, Harris, Jeffrey E. wrote:
>> -----Original Message----- From: Kevin Jenkins
>> [mailto:rakkar@jenkinssoftware.com] Sent: Sunday, March 31, 2013
>> 1:21 PM To: Tomcat Users List Subject: Tomcat how to set -Xms and
>> -Xmx
>> 
>> If I run tomcat7w.exe (windows) there is a tab where I can set
>> the initial and maximum memory pool to 2560. However, I don't
>> want to use tomcat7w.exe, I just want to run the  batch file
>> manually (startup.bat). However, I can't figure out how to set
>> these memory pool values for startup.bat to use.
>> 
>> I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat
>> which contains SET JAVA_OPTS=-Xms2560 -Xmx2560
>> 
>> However, it doesn't work. If I run startup.bat, instead of
>> launching the webserver it just prints some messages and that's
>> it. No webserver is started.
>> 
>> C:\apache-tomcat-7.0.37\bin>startup.bat Using CATALINA_BASE:
>> "C:\apache-tomcat-7.0.37" Using CATALINA_HOME:
>> "C:\apache-tomcat-7.0.37" Using CATALINA_TMPDIR:
>> "C:\apache-tomcat-7.0.37\temp" Using JRE_HOME:        "C:\Program
>> Files\Java\jdk1.6.0_43" Using CLASSPATH: 
>> "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc 
>> at-7.0.37\bin\tomcat-juli.jar" C:\apache-tomcat-7.0.37\bin>
> 
> Add a "call setenv.bat" (with path as necessary) to startup.bat, or
> just add the relevant SET statements directly to startup.bat.

No. Any existing setenv.bat file will be executed before launching
Tomcat. There is no need to modify startup.bat or catalina.bat. Just
create bin/setenv.sh.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRWKCxAAoJEBzwKT+lPKRYSYoQALk264ke+reweEZbW8249iRW
DLDxeupHs4Nefz6EQS8oo7Yb4OlCd43XlQZWgh5wQyI0/1KfVXtJaMYLXjqRXcZW
FXXjnTsw0DtA+7LA1Du/g8ed2+JJmHcpy7BS/JlZPdjgSAUalqMuhJpS1s1ZFoYI
EPkIPTTocHqH1pRnFchML/eX8PZDuiPtgO+YFO+qkwW5fyiCvwoD6K+0kDa1UDSC
pLZ0BjOattHOfNSzJyGVVzD7L/EyZAEJQQqMM0AMv388I1qlPEdwMy94zmcbFiUH
3iRW0AkeZxYf/IxOvvRykFeFrOL784DmTQ8pWA4xB0L9Gj5X5ateqVy6p3sdGkIP
/9OnaZ2ayl1JHQOP0rDb8Au5C3YVO7d3qQg8iulcxwvYYwWS6/+ENsA1Y2WL9BLk
oyExTRl7KISwkk4PeODD3WdLD2uZ33XPv+EUHsyMD3GUs2lpAJhdcvWf5phFUKIh
Pa8H+uyYd+RDAehdkwQ1LubhJ2NDoRUERCWWLigoZOTPkD2oAlWKdXCGEl+5cvVM
tjeOlYojoI39684cf+XTWCokO81O+HaP3B/YVyPooQClWeXpTEke8LwFDFOEXl7f
zr7yhzrkKI+SyMikD6mcqC55fsjbaMalpBnlH7Ik0OlevGmlgWuWJB1OlldrUfMU
JJ9r+T2Q0FIaD/mlrMGt
=u8s7
-----END PGP SIGNATURE-----

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


RE: Tomcat how to set -Xms and -Xmx

Posted by "Harris, Jeffrey E." <Je...@ManTech.com>.
> -----Original Message-----
> From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com]
> Sent: Sunday, March 31, 2013 1:21 PM
> To: Tomcat Users List
> Subject: Tomcat how to set -Xms and -Xmx
>
> If I run tomcat7w.exe (windows) there is a tab where I can set the
> initial and maximum memory pool to 2560. However, I don't want to use
> tomcat7w.exe, I just want to run the  batch file manually
> (startup.bat). However, I can't figure out how to set these memory pool
> values for startup.bat to use.
>
> I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat which
> contains SET JAVA_OPTS=-Xms2560 -Xmx2560
>
> However, it doesn't work. If I run startup.bat, instead of launching
> the webserver it just prints some messages and that's it. No webserver
> is started.
>
> C:\apache-tomcat-7.0.37\bin>startup.bat
> Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
> Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
> Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
> Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> Using CLASSPATH:
> "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
> at-7.0.37\bin\tomcat-juli.jar"
> C:\apache-tomcat-7.0.37\bin>

Add a "call setenv.bat" (with path as necessary) to startup.bat, or just add the relevant SET statements directly to startup.bat.

Jeffrey Harris


This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

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


RE: Tomcat how to set -Xms and -Xmx

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Kevin Jenkins [mailto:rakkar@jenkinssoftware.com] 
> Subject: Re: Tomcat how to set -Xms and -Xmx

> I found the answer. In catilina.bat change

That's the wrong answer.

> Such a common operation should not be so obscure and difficult to figure out

It's not, but you're doing it the hard way, possibly due to some bad advice earlier.  Do not modify startup.bat or catalina.bat; all you need to do is create a setenv.bat file in Tomcat's bin directory, and put the following in it:

set CATALINA_OPTS=-Xms2560m -Xmx2560m

If setenv.bat exists, it will be called automatically by the startup.bat script.  You should use CATALINA_OPTS here, since JAVA_OPTS applies to both the startup and shutdown, and you don't need it on stop Tomcat.

Note that the tomcat7w.exe executable is used only when running Tomcat as a service, not when launching it from batch scripts.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Tomcat how to set -Xms and -Xmx

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Kevin,

On 3/31/13 4:28 PM, Kevin Jenkins wrote:
> I found the answer. In catilina.bat change
> 
> set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% To: set
> JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -Xms2560M -Xmx2560M

You don't want to do this. Instead, you want to set CATALINA_OPTS.
Read the documentation (see below) for the difference. If you set
JAVA_OPTS, you'll find yourself creating a 2.5 GiB heap just to
shutdown Tomcat as well as start it up.

> Such a common operation should not be so obscure and difficult to
> figure out

It's not that difficult to figure out. Read RUNNING.txt that comes
with Tomcat (or linked directly through the documentation from the
"Setup" page... it's the first non-TOC link in the document).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRWKF5AAoJEBzwKT+lPKRY6TYP/2iKQQrRxe5eyFURMN/hnyst
bs1lcOmXMK7XcC1OTNwRrYFP1HR53sMHv7SrsP3SOoiZbC30Ud6xZi9IvHaXfTDy
A8LgbOUbfOKijJeQaVsmKfZnLDgQ7CL6EVDertIbPUREbxJFBCaiDqm3OC/ocIaf
gSYigPOWzNwrIjv7AMgBvJQ8fJkRZsIT5aCUZ+FvC9Z0d4GtsJUCcxpaVgf0Y/DY
dsA1lkLoO/3lmbuNg+MRfJxzGJH1fCrM9omUlOyI6GKCVYnV/PU4wFPqTsEojHJ1
P3y/9Vm7Bo5dCneURtUWLy4mqohrnjP9gAKJhqZd+Qk+mw3rvP1AlstyKzR93NcH
v4fnyI7WvdvkGeBdFSNz8YEFb5WlW8LfRbhUyulBOxerA6i0TesCzPToUbC5LK1Z
XYQfqAraTf0IzlG8jHnJW0g9IfpA3EMXL18ZDi7pCWIAuBGMC/pJcO65Gbf6kW1t
CKUdKzebDLzrSyZ8fI14uuNgO0db5UuhaxYwH1GwMiEya3AuVfVBvBND4qOBzpTt
6IFl0k7PN/BFb3j6wWKOIRy08E3ajI997d9LEAQY4uklTnHWHnLAtEbvshilukVn
ALbbia4QANKZdvXLdi4R8Cus6KCWuY9tgMdJdlAZbA/jAGzVHlflBcQoyN/m3690
FGbfkIuMjNrXkmL2Hma3
=1uz9
-----END PGP SIGNATURE-----

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


Re: Tomcat how to set -Xms and -Xmx

Posted by Kevin Jenkins <ra...@jenkinssoftware.com>.
I found the answer. In catilina.bat change

set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
To:
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -Xms2560M -Xmx2560M

Such a common operation should not be so obscure and difficult to figure out


On Sun, Mar 31, 2013 at 11:38 AM, Mark Eggers <it...@yahoo.com> wrote:

> On 3/31/2013 10:20 AM, Kevin Jenkins wrote:
>
>> If I run tomcat7w.exe (windows) there is a tab where I can set the initial
>> and maximum memory pool to 2560. However, I don't want to use
>> tomcat7w.exe,
>> I just want to run the  batch file manually (startup.bat). However, I
>> can't
>> figure out how to set these memory pool values for startup.bat to use.
>>
>> I read somewhere to create C:\apache-tomcat-7.0.37\bin\**setenv.bat which
>> contains
>> SET JAVA_OPTS=-Xms2560 -Xmx2560
>>
>> However, it doesn't work. If I run startup.bat, instead of launching the
>> webserver it just prints some messages and that's it. No webserver is
>> started.
>>
>> C:\apache-tomcat-7.0.37\bin>**startup.bat
>> Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
>> Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
>> Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
>> Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
>> Using CLASSPATH:
>> "C:\apache-tomcat-7.0.37\bin\**bootstrap.jar;C:\apache-tomc
>> at-7.0.37\bin\tomcat-juli.jar"
>> C:\apache-tomcat-7.0.37\bin>
>>
>>
> From the documentation:
>
> -Xmsn
>       Specify the initial size, in bytes, of the memory allocation pool.
>       This value must be a multiple of 1024 greater than 1MB
>
> -Xmxn
>       Specify the maximum size, in bytes, of the memory allocation
>       pool. This value must a multiple of 1024 greater than 2MB.
>
> So maybe you are trying to specify 2.5 GB, but you've really specified 2.5
> KB. This isn't going to work.
>
> Try the following in setenv.bat:
>
> set "CATALINA_OPTS=-Xms2560m -Xmx2560m"
>
> . . . . just my two cents.
> /mde/
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat how to set -Xms and -Xmx

Posted by Mark Eggers <it...@yahoo.com>.
On 3/31/2013 10:20 AM, Kevin Jenkins wrote:
> If I run tomcat7w.exe (windows) there is a tab where I can set the initial
> and maximum memory pool to 2560. However, I don't want to use tomcat7w.exe,
> I just want to run the  batch file manually (startup.bat). However, I can't
> figure out how to set these memory pool values for startup.bat to use.
>
> I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat which
> contains
> SET JAVA_OPTS=-Xms2560 -Xmx2560
>
> However, it doesn't work. If I run startup.bat, instead of launching the
> webserver it just prints some messages and that's it. No webserver is
> started.
>
> C:\apache-tomcat-7.0.37\bin>startup.bat
> Using CATALINA_BASE:   "C:\apache-tomcat-7.0.37"
> Using CATALINA_HOME:   "C:\apache-tomcat-7.0.37"
> Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.37\temp"
> Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
> Using CLASSPATH:
> "C:\apache-tomcat-7.0.37\bin\bootstrap.jar;C:\apache-tomc
> at-7.0.37\bin\tomcat-juli.jar"
> C:\apache-tomcat-7.0.37\bin>
>

 From the documentation:

-Xmsn
       Specify the initial size, in bytes, of the memory allocation pool.
       This value must be a multiple of 1024 greater than 1MB

-Xmxn
       Specify the maximum size, in bytes, of the memory allocation
       pool. This value must a multiple of 1024 greater than 2MB.

So maybe you are trying to specify 2.5 GB, but you've really specified 
2.5 KB. This isn't going to work.

Try the following in setenv.bat:

set "CATALINA_OPTS=-Xms2560m -Xmx2560m"

. . . . just my two cents.
/mde/

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


Re: Tomcat how to set -Xms and -Xmx

Posted by Michael-O <19...@gmx.net>.
Am 2013-03-31 19:20, schrieb Kevin Jenkins:
> If I run tomcat7w.exe (windows) there is a tab where I can set the initial
> and maximum memory pool to 2560. However, I don't want to use tomcat7w.exe,
> I just want to run the  batch file manually (startup.bat). However, I can't
> figure out how to set these memory pool values for startup.bat to use.
>
> I read somewhere to create C:\apache-tomcat-7.0.37\bin\setenv.bat which
> contains
> SET JAVA_OPTS=-Xms2560 -Xmx2560

You need to set CATALINA_OPTS.


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