X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1EBF6D1B19C for ; Tue, 22 Jun 2004 11:54:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92996-06 for ; Tue, 22 Jun 2004 14:54:25 +0000 (GMT) Received: from mail1.yozons.com (mail1.yozons.com [206.80.109.179]) by svr1.postgresql.org (Postfix) with ESMTP id CF2F8D1B191 for ; Tue, 22 Jun 2004 11:54:18 -0300 (ADT) Received: from rasta (soho2.yozons.com [206.80.109.178] (may be forged)) (authenticated bits=0) by mail1.yozons.com (8.12.8/8.12.8) with ESMTP id i5MEsMX5030635 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Tue, 22 Jun 2004 07:54:23 -0700 Message-ID: <012401c45868$87cf2840$3201a8c0@rasta> Reply-To: "David Wall" From: "David Wall" To: References: Subject: Re: Bug (and fix): leaks of TCP connections when connected Date: Tue, 22 Jun 2004 07:52:24 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/147 X-Sequence-Number: 10349 > 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). 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