You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Joe Reger, Jr." <re...@gmail.com> on 2005/12/03 13:56:57 UTC

How much memory will Tomcat 5.5/Java 5 support?

Hi!  I'm having trouble getting my Tomcat 5.5. production box to use
more than 1.1Gb of memory.

1) When I use the Configure Tomcat console's Java tab to set the
Maximum Memory Pool I can only use a max of 1999Mb.  If I go above
that the Windows Tomcat service will fail to start.

2) Tomcat will start with a configured value of 1999Mb, but when I
view max memory in the app it says that it has a max of about 1140Mb
(sorry, I forgot the exact value... possibly 1048Mb, but i don't
remember it being one of the magic numbers).

Is this a JVM issue or a Tomcat issue?  I've got 4Gb of ram on the
dedicated Tomcat server and I'd like to give 3Gb to Tomcat.

Thanks,

Joe

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


RE: How much memory will Tomcat 5.5/Java 5 support?

Posted by Carl Olivier <ca...@unysen.co.uk>.
Hi Joe.

Well, heres how I run it - and remember this is all dependent on the
beakdown of requirements of the following:

1.  Web app memory needs - how memory intensive are your web apps within
Tomcat going to be?
2.  Concurrent connections (tcp threads) for incoming requests - how busy
will the web apps be?
3.  Are you running DB connections?  Are you using a Connection pool?  How
long will each db connection take to return?
4.  Are you running OTHER applications/servers on the server which will
require memory?  E.g. RDBMS Server
5.  Always be aware that the native OS will also need memory - thus you
cannot just give it all to Tomcat!

So, heres one of my scenarios:

Server:
Quad Xeon
2GB RAM

OS:
Windows 2000 Server (32 bit)

Applications/Servers:
Tomcat 5.0.28 (with 40 web apps/contexts/classloaders)
MSSQL Server 2000

My Tomcat runtime switches are as follows:

-Xms768m   				//assign all the JVM heap at startup
to 768mb
-Xmx768m				//assign max JVM heap
-Xss128k				//set the native thread stack size
memory allocation down from windows def of 1024kb - very useful
-XX:+UseParallelGC			//parralel GC - makes use of the
multiple processors
-XX:MaxPermSize=256m		//up the perm gen space (used for
classloading etc) from def 64mb - also useful with lots of web apps
-XX:+DisableExplicitGC		//don't let the System.gc() be called as it
could cuse 'pause the world's

I also limit the amount of RAM that MSSQL can have to 640mb - and have also
set the memory allocation size per sql connection down from 1024kb to 512kb
(SQL Server setting) - this is however due to my running MSSQL Server on the
same box and may not apply.

I have thus left some RAM for the OS to use where required - this should not
be ignored.

I found that this is a pretty stable setup - with my only problem occurring
occasionally when I get a MAJOR spike in concurrent requests.  I plan to
upgrade to a 64bit OS soon and to up the SQL RAM allocation as my problem
lies there - it sometimes has issues with memory!

It should be noted that my web apps can be fairly SQL intensive - I do have
VM level caching but alas not all of it....

Anyway - I do hope that helps!

Other areas you could look into is the number of concurrent requests Tomcat
serves (set at a Connector level) - as too many will cause memory issues
under load, while too few will cause visitors to be rejected/wait for
response!

Anyway, take care,

Carl


-----Original Message-----
From: Joe Reger, Jr. [mailto:regerj@gmail.com] 
Sent: 03 December 2005 13:19
To: Tomcat Users List
Subject: Re: How much memory will Tomcat 5.5/Java 5 support?

> Are you running a 64bit or 32bit OS?  If 32bit the JVM will not be 
> able to assign higher that 2gb for a single process (which includes 
> system overheads etc).

Hi Carl - I'm 32 bit right now.   I'll check the archive for past posts.

How would you go about using more of the memory that I have on the server?
Can I run two Tomcat services and cluster?

Thanks for the feedback and help!

Joe

---------------------------------------------------------------------
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: How much memory will Tomcat 5.5/Java 5 support?

Posted by "Joe Reger, Jr." <re...@gmail.com>.
> Are you running a 64bit or 32bit OS?  If 32bit the JVM will not be able to
> assign higher that 2gb for a single process (which includes system overheads
> etc).

Hi Carl - I'm 32 bit right now.   I'll check the archive for past posts.

How would you go about using more of the memory that I have on the
server?  Can I run two Tomcat services and cluster?

Thanks for the feedback and help!

Joe

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


RE: How much memory will Tomcat 5.5/Java 5 support?

Posted by Carl Olivier <ca...@unysen.co.uk>.
Hi.

Are you running a 64bit or 32bit OS?  If 32bit the JVM will not be able to
assign higher that 2gb for a single process (which includes system overheads
etc).  You will need to move to a 64bit OS to be able to create higher Heap.

I would check your OS memory/kernel/process memory documentation if I were
you.

There were recently some posts on this list dealing with Tomcat memory -
would suggest reading thrugh those for some useful tips too.

Rgds,

Carl

-----Original Message-----
From: Joe Reger, Jr. [mailto:regerj@gmail.com] 
Sent: 03 December 2005 12:57
To: users@tomcat.apache.org
Subject: How much memory will Tomcat 5.5/Java 5 support?

Hi!  I'm having trouble getting my Tomcat 5.5. production box to use more
than 1.1Gb of memory.

1) When I use the Configure Tomcat console's Java tab to set the Maximum
Memory Pool I can only use a max of 1999Mb.  If I go above that the Windows
Tomcat service will fail to start.

2) Tomcat will start with a configured value of 1999Mb, but when I view max
memory in the app it says that it has a max of about 1140Mb (sorry, I forgot
the exact value... possibly 1048Mb, but i don't remember it being one of the
magic numbers).

Is this a JVM issue or a Tomcat issue?  I've got 4Gb of ram on the dedicated
Tomcat server and I'd like to give 3Gb to Tomcat.

Thanks,

Joe

---------------------------------------------------------------------
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