Konstantin, On 10/2/12 3:58 PM, Konstantin Kolinko wrote: > 2012/10/2 Christopher Schultz <ch...@christopherschultz.net>: >> Konstantin, >> >> On 10/2/12 2:32 PM, Konstantin Kolinko wrote: >>> Running current trunk + Nio connector + JDK 7u7, I see a lot of the >>> following exceptions. >>> >>> It looks like there is some bug in AccessLogValve optimization when >>> StringBuilder was replaced with a CharBuffer. >>> >>> A CharBuffer cannot grow itself? >> >> The API does not seem to say anything about re-sizing CharBuffers. >> > > The CharArrayWriter class can be a replacement here. > > It grows itself. > It is reusable with CharArrayWriter.reset(). > It can write its buffer without creating a copy with > CharArrayWriter.writeTo(Writer).
Sounds ideal. One thing I might consider is whether it can *shrink* at some point. I can imagine some relatively rare use case where someone uses ${xxx}r or %{xxx}s and the resulting string ends up being huge. Then the AccessLogValve has this huge buffer that is not necessary. I'm just thinking about JSP caches, etc. that are often referenced taking up large amounts of heap space because they never shrink. -chris
signature.asc
Description: OpenPGP digital signature