Received: from smaug.polygnosis.com ([195.139.160.221]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5QDOKa47786 for ; Tue, 26 Jun 2001 09:24:20 -0400 (EDT) (envelope-from gunnar@smaug.polygnosis.com) Received: (from gunnar@localhost) by smaug.polygnosis.com (8.11.0/8.11.0) id f5QDO7819975; Tue, 26 Jun 2001 15:24:07 +0200 To: Cc: "'Bruce Momjian'" , "'Barry Lind'" , "'PostgreSQL jdbc list'" Subject: Re: RE: [ADMIN] High memory usage [PATCH] References: <000a01c0fdb0$8512d810$0201a8c0@INSPIRON> From: Gunnar =?iso-8859-1?q?R=F8nning?= Date: 26 Jun 2001 15:24:07 +0200 In-Reply-To: <000a01c0fdb0$8512d810$0201a8c0@INSPIRON> Message-ID: Lines: 30 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200106/115 X-Sequence-Number: 860 * "Dave Cramer" wrote: | | Bruce, Barry, | | How about checking for the existence of the date object in the | constructor? This would mean that it would only be created once per | thread. | I only briefly reviewd the code in PreparedStatement yeaterday with respect to the usage of the SimpleDateFormat, my comments : - Why the ThreadLocal usage, and not just syncronize on the same SimpleDateFormat ? - It seems to that the SimpleDateFormat is never modified after creation. Wouldn't this mean that we actually could assign the SimpleDateFormat object to a static member, so we only had to create the object once. Or is concurrent usage of SimpleDateFormat.format() unsafe ? I would prefer the latter if safe, as we would get less object creation and synchronization. regards, Gunnar -- Gunnar Rønning - gunnar@polygnosis.com Senior Consultant, Polygnosis AS, http://www.polygnosis.com/