Discussion:
Tomcat - Xms and Xmx size
abdul razack
2009-11-17 04:30:44 UTC
Permalink
Hi,
 
I am using tomcat-5.5.23 for JSP/servlet application on Windows server 2003. The database is SQL SERVER 2005  and  java version is jdk_1.5.0_12.
 
Currently the maximum and minimum heap size(-Xms256m -Xmx256m) has been configured as 256MB.
 
 Very frequently (almost every 10 days)  I am getting Out of memory errors.
100 user are using JSP/servlet application.
 
 Please let me know whether maximum and minimum heap size can be configured to 512MB.  What is the upper limit? I am using RAM 3.5GB.
 
Thanks & Regards
-Abdul Razack 
 
Caldarale, Charles R
2009-11-17 04:35:47 UTC
Permalink
Subject: Tomcat - Xms and Xmx size
 Please let me know whether maximum and minimum heap size can be
configured to 512MB.  What is the upper limit? I am using RAM 3.5GB.
The amount of RAM is largely irrelevant. On a 32-bit Windows system, heap size is limited to around 1.5G when using 2GB process space, a bit more with 3GB process space. However, raising the heap size will only postpone the inevitable - you need to fix your memory leak. Use a profiler to find out what's consuming the heap space, and then fix it. Even the free profilers included in the JDK will help.

- 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.
Neil Aggarwal
2009-11-17 04:39:35 UTC
Permalink
Post by abdul razack
 Please let me know whether maximum and minimum heap size can
be configured to 512MB.  What is the upper limit? I am using
RAM 3.5GB.
You can set the heap size to whatever you want.
There is no restriction from Tomcat.

If you have 3.5 GB RAM in the machine, I would set
the heap no larger than 3 GB. Considering you
are at 256 MB now, set the max to 1 GB and it should
be plenty large for you. If you stil run out of
RAM, you probably have a memory leak in your
application.

Neil

--
Neil Aggarwal, (281)846-8957, http://UnmeteredVPS.net
Host your tomcat app on a CentOS VPS for only $25/month!
Unmetered bandwidth, 7 day no risk trial, Google Checkout
Caldarale, Charles R
2009-11-17 04:44:12 UTC
Permalink
Subject: RE: Tomcat - Xms and Xmx size
You can set the heap size to whatever you want.
There is no restriction from Tomcat.
Not quite true; a 32-bit Windows environment normally has a 2 GB process space, and everything has to fit within that - Java heap, C heap, code, stacks, etc.
If you have 3.5 GB RAM in the machine, I would set
the heap no larger than 3 GB.
Not possible on a 32-bit Windows system.

- 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.
Neil Aggarwal
2009-11-17 05:02:21 UTC
Permalink
Post by Caldarale, Charles R
Not quite true; a 32-bit Windows environment normally has a 2
GB process space, and everything has to fit within that -
Java heap, C heap, code, stacks, etc.
Post by Neil Aggarwal
If you have 3.5 GB RAM in the machine, I would set
the heap no larger than 3 GB.
Not possible on a 32-bit Windows system.
You are correct.

Everything I do is on 64 bit systems now so
I don't pay attention to those limits anymore.

Thanks for keeping me honest!

Neil

--
Neil Aggarwal, (281)846-8957, http://UnmeteredVPS.net
Host your tomcat app on a CentOS VPS for only $25/month!
Unmetered bandwidth, 7 day no risk trial, Google Checkout

Loading...