tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Monimoy Deb <>
Subject Question on JVM maximum heap size parameter in tomcat
Date Thu, 02 Aug 2007 17:08:51 GMT
   I am using tomcat5.0 web server in Linux. At the
time of tomcat startup, the maximum heap size for JVM
is  specified using Xmx parameter in, for

java -Xms128m -Xmx1337m -classpath
org.apache.catalina.startup.Bootstrap start

The issue I found in some linux machines is that if
Xmx parameter is too high, The tomcat does not startup
and the tomcat log entry is as below

 " Error occurred during initialization of VM.
 Could not reserve enough space for object heap."

When Xmx parameter value is reduced manually then only
tomcat works.  For example,
 in one  scenario, the total physical memory of the
machine was 4GB, Xmx parameter
 was 2640MB, but tomcat did not start and I got the
message as above. When I reduced the Xmx parameter to
1.5GB, then the tomcat was Started.

I am looking for logic to specifying the optimal value
for Xmx parameter so that the parameter need not be
changed manually. In other
 words, is there any relationship between optimal Xmx
value and some of the rseources in machine like total
physical memory, available physical memory, 
swap space etc.

Couple of observations that I had:

1. For 32 bit processors the maximum heap size can be
specified is 1.8GB. But tomcat can use both
 32 bit processor as well as 64 bit processor

2. When I gradually increase the Xmx parameter and
start tomcat,  just after the maximum Value of Xmx
parameter for which  tomcat works,  I find a Error
message like 

" Exception in thread "CompilerThread1"
java.lang.OutOfMemoryError: requested 1292
36 bytes for Chunk::new. Out of swap space?"

So, it seems to me that Java Virtual machine uses swap
space as well as available
 Physical memory for allocating maximum Heap size.

So, I am looking for the logic for specifying optimum
value for Xmx parameter which I can specify without
any manual intervention. Please provide me any help on


Yahoo! Answers - Got a question? Someone out there knows the answer. Try it

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

View raw message