Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4DC2D7C3 for ; Tue, 2 Oct 2012 20:43:03 +0000 (UTC) Received: (qmail 25410 invoked by uid 500); 2 Oct 2012 20:43:03 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 25233 invoked by uid 500); 2 Oct 2012 20:43:03 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 25222 invoked by uid 99); 2 Oct 2012 20:43:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Oct 2012 20:43:02 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.62.96] (HELO qmta09.westchester.pa.mail.comcast.net) (76.96.62.96) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Oct 2012 20:42:54 +0000 Received: from omta17.westchester.pa.mail.comcast.net ([76.96.62.89]) by qmta09.westchester.pa.mail.comcast.net with comcast id 6Bo31k0091vXlb859Lid5z; Tue, 02 Oct 2012 20:42:37 +0000 Received: from Christophers-MacBook-Pro.local ([69.143.109.145]) by omta17.westchester.pa.mail.comcast.net with comcast id 6Ldg1k00l38FjT13dLdhS6; Tue, 02 Oct 2012 20:37:41 +0000 Message-ID: <506B5086.2040307@christopherschultz.net> Date: Tue, 02 Oct 2012 16:37:26 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: trunk: An buffer exception in AccessLogValve.log(..) References: <506B350C.7090101@christopherschultz.net> In-Reply-To: X-Enigmail-Version: 1.4.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigFC84E5F3D224426EF30D7543" --------------enigFC84E5F3D224426EF30D7543 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Konstantin, On 10/2/12 3:58 PM, Konstantin Kolinko wrote: > 2012/10/2 Christopher Schultz : >> 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. >> >=20 > The CharArrayWriter class can be a replacement here. >=20 > 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 --------------enigFC84E5F3D224426EF30D7543 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlBrUIkACgkQ9CaO5/Lv0PDB4QCdE/CXK9GXFeErK8WqMufQJn7B JecAn1BYA8wHekjkCoQJfyeQTCsMsC2M =EWYQ -----END PGP SIGNATURE----- --------------enigFC84E5F3D224426EF30D7543--