Hi Mark, This is interesting. I got a snapshot of the memory. I found just about 91 instances of this class (org.apache.jasper.runtime.BodyContentImpl). Just 91, so I guess the quantity of buffers at the same time is small, maybe they belong to a pool and the maximum quantity of objects in the pool is 100? I'm just guessing. Well, one of them was as big as 18MB! The second one almost the same.... about the first 10 of them where HUGE. Then the rest where more reasonable, between 1 and 50KB. How can a page in my site be as big as 18MB? It definitely can't happen. But for some reason, the buffer was that big in a certain point of time.
I inspected the content of them, and they were not huge inside, just a few KB of HTML code inside and the rest was spaces or some invisible character. I mean, these instances of the class contained a huge array of chars, buf only the first hundreds/thousands of them contained HTML code, but given that the busfferSize variable contained a big value (18 millons), the object thought it had a huge full buffer containing real values. I guess something wrong happened, maybe an exception ocurred or I undeployed my app at that very moment (or something else went wrong) and this huge buffers got wrongly full of dummy characters and then stayed in the limbo, until the GB would delete them? Or now that I think more about it, they stayed in the memory to be reused again, being objects in a pool, their "nextChar" variable (a pointer) was reset to a small value, but their hugely increased internal array of chars was going to stay as big as the biggest they were... like you said. I will set the LIMIT_BUFFER value now, I guess that will solve it as you said. When the buffer gets cleared after it is being used every time, and the LIMIT value =true, the buffer will shrink to 512 bytes again, huh? That will be nice. :-) > -----Original Message----- > From: Mark Thomas [mailto:ma...@apache.org] > Sent: Saturday, November 13, 2010 07:21 AM > To: Tomcat Users List > Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? > > On 12/11/2010 20:35, Brian wrote: > > Ok, I will do that now! > > > > I have taken another snapshot of the JVM a few minutes ago. Now I also > > see that 160MB are being used by > org.apache.jasper.runtime.BodyContextImpl. > > This contains images of my DYNAMIC pages! > > That is sort of what I'd expect. A little background: > > Tag bodies have to be buffered. > Jasper (Tomcat's JSP engine) uses a pool of buffers. > Tag bodies are expected to be small. > The buffer grows (but does not shrink) if the body is large. > > If you have a lot of tags that have large bodies then you can see an increase in > memory usage in this area. To control this see > org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER on > http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html > > HTH, > > Mark > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org