From: David Wall <d.wall@computer.org>
To: pgsql-jdbc@postgresql.org
Subject: Re: Bug (and fix): leaks of TCP connections when connected
Date: Tue, 22 Jun 2004 07:52:24 -0700
Message-ID: <012401c45868$87cf2840$3201a8c0@rasta> (raw)
References: <A13B47F8EC3FD111A91500C04FD2A2820567E6FD@exchange.elca.ch>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: d.wall@computer.org
Subject: Re: Bug (and fix): leaks of TCP connections when connected
In-Reply-To: <012401c45868$87cf2840$3201a8c0@rasta>
References: <A13B47F8EC3FD111A91500C04FD2A2820567E6FD@exchange.elca.ch> <012401c45868$87cf2840$3201a8c0@rasta>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox