tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gordon Smith" <>
Subject RE: Out of Memory Error
Date Mon, 26 Jun 2006 15:39:33 GMT
I'd suggest that you try the following JVM options in your Tomcat JAVA_OPTS
environment variable (before deploying these changes in production, test
these options in an isolated environment with stress testing tools if at all

JAVA_OPTS= -Xms1024m -Xmx1024m -verbose:gc  -server 

- By making -Xms and -Xmx the same, you will minimize CPU cycles spent on
growing the block of memory allocated to the Tomcat JVM by the OS.  If you
have more memory available, use it for Tomcat, so long as you allow
sufficient "headroom" for other services you may be running, as well as the
OS itself.  Test to determine how high you can safely go with these parms.

- The -verbose:gc option will output statistics to the Tomcat console that
will tell you the "before" and "after" memory stats behind JVM garbage
collection operations.  Use the "after" number to determine approximately
how much RAM the Tomcat JVM is consuming at a given moment.  Much of the
time, the JVM does not use all the memory shown by the Windows Task Manager
as being in use.

- As I understand it, the -server option is generally recommended when using
Tomcat in a server environment.

That aside, buy enough (>=2G) RAM so that you can take advantage of a larger
memory allocation.  Win 2K permits a total of 4G per process; 2G of that is
mapped to the OS kernel leaving 2G for your app.  If you only have 1G or so
installed, you're missing an opportunity for an inexpensive way to increase
performance and decrease downtime and hair loss!

Hope this helps.

Gordon Smith

-----Original Message-----
From: Marco Aurélio Seraphim da Silva [] 
Sent: Monday, June 26, 2006 11:09 AM
Subject: Out of Memory Error

Hi folks,

I'm using Tomcat 5.0.28 with JVM 1.4.2 (running only Tomcat) under a Win
2000 Server, and it starts to give me the following message:

To prevent this I start Tomcat using this 2 parameters:
-Xms 521m
-Xmx 1024m

But this isn't enought, some times when the server is a bit stressed the
server memory, used by the JVM incrises up to 1GB and some MB more, then
decrises to 700MB, and starts to increse again up to 1GB.

The memory used increses just as the app sessions, but when the JVM used
memory get at 1GB I have at about 400 sessions. I'm thinking that is to much
memory for 400 sessions on this app.

I'm afraind becuse the memory get up to 1GB when the server is not full

There's something I can do to reduce the amount of memory used by the JVM,
or it's normal???


Marco Aurélio Silva

To start a new topic, e-mail: To unsubscribe,
For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message