tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: trunk: An buffer exception in AccessLogValve.log(..)
Date Tue, 02 Oct 2012 22:22:02 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/10/2012 21:37, Christopher Schultz wrote:
> 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?

My bad. I'll fix that.

>>> 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.

+1.

> 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.

There is a limit (set at 256 characters) and if the buffer is above
this size it gets thrown away rather than recycled.

Mark

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQa2kKAAoJEBDAHFovYFnnM74P/08DdXdAWynBV+3cCViOnDGw
nLNXAH7/E2FZTbyWb0HjbEjKwEY2JxdL71mHTEudNLRYvR3M5ZYXGId7J4jX4CXS
uNZFLnEUJH9Dx4sdLwsD6gIbJtDReD0zLkl1yJS2Bfq+ssdKXtZ8dqPgwYx34BYK
OExsh9lBH9TRY0CUf+Sfm8v+s2wOBu4Y00IHw7+yFRmHPLJVS/YzcLP2YwLGBZxI
N2uq35HHWXmbGd+UbAVD6w4UVFJdXxNk3BBS2NFOwT55SaqPJG6II/Bl+3MKHN2s
0AtOjCjioWxJT8cqxmSkserbX+Z0QDO4FJe3QEoBndRh+z9XOJ6Y6kBJp/EcsRYA
gG1wWOqM1hShVVpn12YGimGa13Ki+B/uoDxO8RlA6pDbh3puhZ0pq4/oWkrAR1hJ
bzyUSs3w2wD/Um7acKQfntj8tZRKt37oeFclAqMZmJmPVaDhqBQMJxUvo8UQvGYF
gZVJFNDSJInjfI8Lss4MFl6ErNwfwN6zYhLtzQVjiEzF5idJCTk9pt0Z7raFt0Em
+SM+bW3bLfW1qSpAmlIuismMDadwNY4k/vobRa607b9fi7sABAlk9wlMuRWQfFd4
InPTEFYGvX33aNZ9HmvJJmw9XTJHNowUcYv+XuLZ/TuDuJMveOv6+VVZORQoKada
6gR8WCGWxPI9JmBLsUo/
=ggGG
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message