tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan D." <>
Subject Re: Out of Memory Errors when upgrading from 5.0.27 to 6.0.14
Date Thu, 07 Feb 2008 21:14:46 GMT
Most of the advice that I received on this topic was pretty much the same: 
Use a profiler to determine what is using the heap.

I went out and got a demo copy of yourkit as Filip suggested, and ran it 
against a 512MB heap dump (lowered max heap to that, and
used the heap that was dumped on OOME).

Well over half of the heap was consumed by 

This lead me back to my suspicion that the issue may lie with the number of 
directories that are created in the tomcat work/engine/application 

The following example explains the difference in behavior between Tomcat 5 
and Tomcat 6 that I am seeing:

Customer has the following directory structure:

|    \_ classes/
|    \_ lib/
\_ images/
\_ movies/
\_ mp3s/
\_ blog/
\_ new_application.war

Now, in Tomcat 5, they would have a work directory structure of the 
    \_ ./application_name
        \_  _ (the directory name is simply “_”)
        |     \_ tldCache.ser
        \_   new_application
        \_ tldCache.ser

Tomcat 6, however, would set it up as follows:

\_  _
\_ new_application
\_ images/
\_ movies/
\_ mp3s/
\_ blog/

Add in a few more directories for flair (say, for subdomains / aliases / 
other applications), and we can see that the number of these directories 
that are created gets out of hand quickly.

To put numbers on it, for Tomcat 5, we have a total of ~11,000 files and 
directories in the {tomcat.home}/work/{} directory and 
subdirectories.  In Tomcat 6, it fails on OOME at around 27,000 directories.

So, I suppose my question is, is this behavior intended?  Is there a config 
option I can use to disable it at all, or do we simply have to reduce the 
number of applications that are being run under the new version?

As a side note, I was able to eventually get Tomcat to start, once I removed 
a number of applications that had the highest count of directories that were 
created in the work directory structure.

Also, we do hope to move to 64bit versions soon, but they aren't here yet, 
so I only have the 32 bit to work with.

Thanks for your help,


From: "Christopher Schultz" <>
> Hash: SHA1
> Dan,
> (While others are handling your primary question, I thought I'd mention
> a couple of things)

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

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

View raw message