Re: RE: [ADMIN] High memory usage [PATCH]

Поиск
Список
Период
Сортировка
От Michael Stephenson
Тема Re: RE: [ADMIN] High memory usage [PATCH]
Дата
Msg-id Pine.LNX.4.30.0106261432330.21133-100000@tirin.openworld.co.uk
обсуждение исходный текст
Ответ на Re: RE: [ADMIN] High memory usage [PATCH]  (Gunnar Rønning <gunnar@polygnosis.com>)
Ответы Re: Re: RE: [ADMIN] High memory usage [PATCH]  (Gunnar Rønning <gunnar@polygnosis.com>)
Список pgsql-jdbc
> 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 ?

This won't scale. :o)

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

SimpleDateFormat.format() and SimpleDateFormat.parse() are not threadsafe,
I believe the relevant 'bug' is 4228335.

> I would prefer the latter if safe, as we would get less object creation and
> synchronization.

The latter is what we used to have until it became clear that it wasn't
threadsafe.

I think the ThreadLocal solution is the best one available in the
circumstances.

Michael xxx


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Gunnar Rønning
Дата:
Сообщение: Re: RE: [ADMIN] High memory usage [PATCH]
Следующее
От: Gunnar Rønning
Дата:
Сообщение: Re: Re: RE: [ADMIN] High memory usage [PATCH]