tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: trunk: An buffer exception in AccessLogValve.log(..)
Date Tue, 02 Oct 2012 20:37:26 GMT
Konstantin,

On 10/2/12 3:58 PM, Konstantin Kolinko wrote:
> 2012/10/2 Christopher Schultz <chris@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


Mime
View raw message