tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <>
Subject Re: Memory leak? (
Date Fri, 05 May 2006 15:41:22 GMT
Remy Maucherat wrote:
> Rainer Jung wrote:
>> I'm wondering if we should split the (possibly huge) char arrays in 
>> BodyContentImpl into smaller chunks of char arrays. Each chunk will 
>> be able to grow big enough to handle the usual cases efficiently 
>> (e.g. 64KB). Whenever a bigger size is needed we allocate more of 
>> these chunks from a pool. After using the BodyContentImpl we give 
>> back all chunks except for the first to the chunk pool.
>> This way performance should not really suffer, but the char arrays 
>> can be efficiently shrinked for apps needing generating large 
>> responses every now and then.
> This could be a good idea, but performance would suffer, I think: if 
> one request needs 100 buffers, then you'll have 100 synced operations 
> to retrieve them from the pool (only one to put them back, hopefully 
> ;)). It could then be cheaper to always allocate new objects.
yes, but in TC6 we can use java.util.concurrent, and get a little bit 
more juice out of it, there is a pretty big difference between the lock 
free thread safe operations and the lock algo ones we use today 


> Rémy
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message