Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group