Re: Bug (and fix): leaks of TCP connections when connected

Поиск
Список
Период
Сортировка
От David Wall
Тема Re: Bug (and fix): leaks of TCP connections when connected
Дата
Msg-id 012401c45868$87cf2840$3201a8c0@rasta
обсуждение исходный текст
Ответ на Re: Bug (and fix): leaks of TCP connections when connected  (Laurent Sylvain <sylvain.laurent@elca.ch>)
Ответы Re: Bug (and fix): leaks of TCP connections when connected  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
Список pgsql-jdbc
> There's no finalizer on the Socket class that closes it so that even if it
> is garbage collected, the socket is not closed at the OS level. I think I
> saw somewhere this was done by design and actually I believe it's much
> cleaner to properly close the socket before losing any reference to it so
> that OS resources are freed as early as possible. Much better for
> scalability ;-)

"By design," huh?  We call such thinking: bugs on purpose (also known to the
anti-MSFT crowd as windows programming). <smile>

Yes, it's best to clean up.  But no, a finalizer should discard any open
resources as that what it was designed for.  After all, if the object is
GCed, then nobody is using it, so nobody ever will close it.  At any rate,
sounds like the PG team has already fixed the leak in its code.  Thanks
guys.

David


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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Bug (and fix): leaks of TCP connections when connected
Следующее
От: "Marcus Andree S. Magalhaes"
Дата:
Сообщение: Re: Bug (and fix): leaks of TCP connections when connected