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.
The case in which this will be worse is, when most of the requests 
generate large responses. For this case, maximum chunk size could be 
configurable.
I didn't dig through the code, whether the change from a simple char 
array to a flexible list of char arrays will be a difficult one, but I 
will go through it and try to implement it, if there's no big warning 
coming from the list.
Remy Maucherat wrote:
Jeff Turner wrote:

1 May:  93 Objects (126Mb)
2 May:  107 Objects (263Mb)
3 May:  492 Objects (486MB)

BodyContentImpls are pooled and reused since it makes JSP processing significantly faster. If the application is evil, and uses body tags with huge bodies (it seems to be the case here), then there could be a problem.
Large buffers may be discarded after usage, by setting the 
"org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER" system property 
to "true". Unfortunately, performance will go down and GC activity will 
go up.
If you would like to limit the amount of resident memory that is used, 
you can disable pooling of buffer objects completely using the 
"org.apache.jasper.runtime.JspFactoryImpl.USE_POOL" system property set 
to "false". The performance will go down further due to object 
allocations and GC activity, but you may have a few CPU cycles to spare.
BTW, you can set system properties in the catalina.properties file 
(although you may set them on the command line too).
Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to