tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: 1067 error when starting service after allocating more memory to JVM
Date Sat, 07 Aug 2004 18:31:29 GMT
> From: Stephen Charles Huey []
> Subject: 1067 error when starting service after allocating more memory to JVM
> Hey, we've been running Tomcat 4.1.27 for a couple of years on our
> webserver, and we just upgraded the server from 2GB of memory to 3GB. 
> We've been allocating 1GB to the JVM when installing Tomcat as a
> service, but now we'd like to do 2GB, so I just changed the two
> instances of 1024 to 2048 in this:

The short answer is you can't do that.

The long answer is, as usual, a bit more complicated.  First, Windows normally splits the
4GB virtual space into 2GB for each user process, and 2GB for the operating system, shared
across all processes.  There is an option for Windows Server bootstrap to change this boundary
to 3GB for user processes and 1GB for the OS (sorry, I don't remember the tag).

Second, the virtual space that Windows gives each user process is fragmented by DLLs scattered
around in it, and the Sun JVM insists on having one contiguous area for its heap (at least
it did in 1.4.1; have not verified this in 1.4.2).  This makes it difficult to get a whole
lot more than 1GB for the heap.

Third, there is (or possibly was) a bug in the JVM heap initialization that failed to treat
the specified sizes as unsigned, so 2GB and above was treated as negative.  Lots of weird
results from that.  Again, I haven't looked in the 1.4.2 code, so this may have been fixed
by now.

Your best bet is to do a binary search with -Xms/-Xmx and see what your environment will handle.
 You don't need to do this with Tomcat - just specifying -version will suffice.  (Just make
sure you put the heap settings before -version, because anything on the command line after
-version is ignored.)

 - Chuck

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.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message