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

From: "David Wall" <d(dot)wall(at)computer(dot)org>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug (and fix): leaks of TCP connections when connected
Date: 2004-06-22 14:52:24
Message-ID: 012401c45868$87cf2840$3201a8c0@rasta
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marcus Andree S. Magalhaes 2004-06-22 16:36:56 Re: Bug (and fix): leaks of TCP connections when connected
Previous Message Kris Jurka 2004-06-22 09:37:15 Re: Bug (and fix): leaks of TCP connections when connected