Re: RE: [ADMIN] High memory usage [PATCH] - Mailing list pgsql-jdbc

From Gunnar Rønning
Subject Re: RE: [ADMIN] High memory usage [PATCH]
Date
Msg-id m2sngnbci0.fsf@smaug.polygnosis.com
Whole thread Raw
In response to RE: RE: [ADMIN] High memory usage [PATCH]  ("Dave Cramer" <Dave@micro-automation.net>)
Responses Re: RE: [ADMIN] High memory usage [PATCH]
List pgsql-jdbc
* "Dave Cramer" <Dave@micro-automation.net> 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/

pgsql-jdbc by date:

Previous
From: "Dave Cramer"
Date:
Subject: High Memory Usage Patch -- Disregard my last message
Next
From: Michael Stephenson
Date:
Subject: Re: RE: [ADMIN] High memory usage [PATCH]