Hi We have a similar problem with IBM JDK 1.3.0 (JIT enabled). I suggest to debug the garbage collector (gc) by turning on the -verbosegc command option. The garbage collecting activity will be written to stderr.
In our case I suspect that it is JVM problem because the output shows that 90% heap is free, but still the OutOfMemoryException occurs sometimes. The exception occurs when the servlet application tries to allocate big amount of memory (5Mb). Even if we set the -Xmx128m and -Xms128m the error occurs, although the output shows that there is 90% (115Mb) free space in heap. I suspect that the OutOfMemoryError occurs because the heap gets too fragmented, therefore the gc can't allocate big sequential memory area. This makes me believe that the heap defragmentation process takes place very seldom. If big amount of memory is needed then it is allocated from the end of the heap, but if the heap size grows close to the maximum, then the exception occurs. Does anybody know if there is a way to force the defragmentation to occur more frequently? I have stress tested our application Sun JRE 1.2.2, and the OutOfMemoryError never occurred. With IBM JDK we minimized the occurrences of OutOfMemoryError by setting the -Xms64m and -Xmx128m. In this case the garbage collector keeps the heap size somewhere between min and max. Example from our log: 86% free (92324744/107150328). But if we generate too much load then we still get the OutOfMemoryError. But at the moment our application doesn't get so much load, so the OutOfMemoryExcpetions are rare. Would be very thankful if anybody could confirm/explain my suspicions, Tõnu > -----Original Message----- > From: Hawkins, Keith (Keith) [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 18, 2001 7:34 PM > To: [EMAIL PROTECTED]; tomcat-user > Subject: Ever increasing heap size with Tomcat 3.2.3 !!! > > > > Hello, > > Before my manager insists that we switch to JRun, can any of > the Tomcat > developers help with a problem of an ever increasing heap size of the > Tomcat java.exe. ?? (We are running Tomcat 3.2.3 and > JRE1.3.1. and the > IIS redirector) > > We are running a load test using LoadRunner scripts on some JSP and > servlets that are running under Tomcat. The load is not all > that heavy > but the heap size of the Tomcat java.exe process keeps growing and > growing. We modified the java command line to start with -Xmx128m to > allow 128 MB of heap but we still max out after a day or so. We even > modified one of our servlets to create a thread that runs > Runtime.gc() > every 30 seconds. The LoadRunner scripts just keep logging > in the same > 5 people via our authentication servlet so you would think memory use > would level out at some point. > > Nothing we do seems to keep the heap size from growing. > > Are there known issues with Tomcat and heap size?? > > Doing a web search revealed numerous posts with people having similar > problems so I believe there is a problem. The standard > response these > people receive is to increase the heap size via -Xmx But that seems > like a band-aid rather than a real solution. That just delays the > inevitable. > > Any insight as to how to keep the Tomcat process from > grabbing more and > more memory would be appreciated. > > Thanks, > Keith > > > > > > > > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>