Skip to main content

Can not increase the Max pool memory from tomcat5w.exe for a tomcat service

2 replies [Last post]
Joined: 2008-02-04

I have a tomcat service on a windows 2003 server. I have a 4G RAM on this server machine. When I try to increase the Max pool memory from the tomcat5w.exe tool by inserting 2000 in the Max pool memory text field, and try to restart the service; it gives me an error and the service does not get restarted.

Does any one have any suggestion or has experienced similar problem?

Thank you in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-07-11

You are most likely hitting the virtual memory address space limit of a 32-bit Windows
process. On most Windows systems, the maximum size of the process address space
is 2GB (the remaining 2GB is used for the Window's kernel address space). It's possible
to configure 32-bit windows to give 3GB of the address space to the process (thus leaving
only 1GB for the kernel), but this feature has issue for Java.

Java needs contiguous virtual address space for the Java heap and the Perm Gen.
If you specify a -Xmx and -XX:MaxPermSize value that is too large, Java won't be
able to get the needed virtual address space. Furthermore, if you try to take advantage
of the 3GB process address space that Windows offers, Java won't be able to use
this additional address space because the additional address space is not contiguous
with the first 2GB, (things get loaded that break it up) thus preventing Java from getting
the contiguous virtual address space that it requires.

There are a number of things you can try to do to get a larger heap in this situation.
First, you could try to reduce the size of the Perm Gen, if possible. Next, if you have
a large number of threads, you could also try to reduce the size of the thread stack
with -Xss. The default size is something like 360KB, IIRC, but is dependent on the
specific version of Windows. The size you choose depends on the application, and
choosing a size that's too small can result in stack overflow errors - so be careful.

If reducing the size of the perm gen and thread stacks still doesn't get you to your
desired Java heap size, then the alternatives are to move to either a Windows 64-bit
system and deploy a 64-bit JVM or to move to some other operating system, such
as Solaris 10 or Linux 2.6 or later that support 4GB virtual address space sizes
for 32-bit processes. There may be other options, but these are the ones that I'm
aware of.

Choosing the 64-bit option will usually result in a slow down of your application, as
all addresses are now 64-bit values and that puts additional pressure on the processor
caches. How much of a hit tends to be application dependent, but expect anywhere
from 0% to 20%.


Joined: 2008-02-04

Thank you Brian for your help,

Our system is apparently a windows 32-bit and I don't think it is feasible to move to 64-bit. I have tried decreasing the max perm gen to 80m and thread stack (e.g. -Xss180k), but still the service did not get restarted.

I realized that the system stops allowing me to increase the max poll at around 1500mb.

Any Idea..