Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ2XV-0003sW-8F for pgsql-jdbc@arkaria.postgresql.org; Wed, 23 Oct 2013 17:48:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VZ2XU-0001wI-Nt for pgsql-jdbc@arkaria.postgresql.org; Wed, 23 Oct 2013 17:48:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ2XT-0001wB-Oa for pgsql-jdbc@postgresql.org; Wed, 23 Oct 2013 17:48:11 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ2XL-00060S-Qn for pgsql-jdbc@postgresql.org; Wed, 23 Oct 2013 17:48:11 +0000 Received: by mail-pa0-f49.google.com with SMTP id lj1so1279992pab.22 for ; Wed, 23 Oct 2013 10:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lBX2UjneyHP3739Ic+7EXDjnlVyC1CzyGDT6N6ZMRbI=; b=ELPFsSv78wY7PFSDMzDd3BtIqgmF00T7WqvmoLlrS7lT4ZtGydcq87c3edllXo+R7p X+nnhtxEk1ARD9JoWIUswmsMGOw8UI1puSNArKw6E9hEoC1iH3Cy2liHcziI/HZd05Jw Dq/hPX0MmJnmerKn7+Oti+T1ohXxqV/BoA8PqVvKHo+4xFr6DkYVpFYP7s3eMqYV49Na FxAhnz1oi59lQzPtYZk7RgrnQb4132s0RM5VfPAsmhYyiWfzr/Z5ROUL2SfD/FyluLmb i5BZ7pxn88g82m0ECC8Npt0oKxV3cPYD44lBApNcBVj0eon6Ym3v+40zbJGfHPW68zwA 64Og== X-Received: by 10.68.170.225 with SMTP id ap1mr2790091pbc.117.1382550480961; Wed, 23 Oct 2013 10:48:00 -0700 (PDT) Received: from [172.20.12.26] (75-149-43-193-SFBA.hfc.comcastbusiness.net. [75.149.43.193]) by mx.google.com with ESMTPSA id i10sm17225383pat.11.2013.10.23.10.47.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Oct 2013 10:47:59 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Remove usage of finalizers ? From: Steven Schlansker In-Reply-To: <52677946.4090907@hogranch.com> Date: Wed, 23 Oct 2013 10:47:58 -0700 Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <9E5438C0-0A2E-4543-BE06-1E7A6D0E3B83@pilhuhn.de> <4EFCA605-80FE-4D6F-90CE-C124984C95AB@pilhuhn.de> <52677946.4090907@hogranch.com> To: John R Pierce X-Mailer: Apple Mail (2.1510) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Oct 23, 2013, at 12:22 AM, John R Pierce wrote: > On 10/23/2013 12:06 AM, Vitalii Tymchyshyn wrote: >> I am not big fan of finalizes. But you propose to remove mechanism that = works most times, without introducing anything else. >> You are saying that as in my incorrect application (and I am 95% sure yo= u've got incorrect application if you are getting finalizing objects piled = up) it does not work, let's remove it altogether and make driver also wrong. >=20 > as an outsider to this stuff, with only a superficial understanding of th= ese finalizers, it seems to me they should log a warning if anything leaks = to them. you don't get rid of them entirely, they provide backup sweeping = up of neglected debris.. >=20 The specific problem with this is that the mere presence of a non-empty fin= alizer increases the cost of object allocation and deallocation by orders o= f magnitude (as is claimed by many Java performance resources). All correc= t applications pretty much have to deallocate these objects explicitly, as = the GC can leave the resources lying around for unbounded time. So having = these finalizers penalizes the correct applications (which I have not obser= ved in practice, but OP seemingly has) by some amount. Maybe the best thing would be for the OP to distill the problem down into a= self-contained code example so we can verify that there aren't any other e= rrors that might be contributing to this problem? It seems that if the pro= blem was really that big, someone else would have run across it. Best, Steven --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc