pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Steven Schlansker <stevenschlansker@gmail.com>
Cc: Adib Saikali <adib.saikali@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Remove usage of finalizers ?
Date: Wed, 23 Oct 2013 21:26:13 +0300
Message-ID: <526814C5.8060106@vmware.com> (raw)
In-Reply-To: <30D0DB98-4224-425A-B99B-C4BF5CBC30AB@gmail.com>
References: <9E5438C0-0A2E-4543-BE06-1E7A6D0E3B83@pilhuhn.de>
	<CABWW-d2rT-dGEh-hrtemgo2z6dm5H2VUz86y-xmgs3p_6Hv+_w@mail.gmail.com>
	<E177372F-3F90-4F1D-9A34-84B3A678A988@pilhuhn.de>
	<CABWW-d2EfWuCV7ZDGoWpz1GiFEM_zNX6rq1PHdHNm_HbZ3EM2w@mail.gmail.com>
	<B86EB807-F8DF-4F2A-BBC9-6CAB925FCDE9@pilhuhn.de>
	<CADK3HH+CaUF3gG-D3fTZn4OeKdP+39=iqgww1Wp7hYBiypKidg@mail.gmail.com>
	<CAPPfruy+mPWfg9WmWQGaRVTAQS9kBgF1pi9oJB4ZcgRyZ87few@mail.gmail.com>
	<CABWW-d1iMgM9-fs2uJ2Vk5rTQnN29nvUvfhQUg0k=jxao-T_KA@mail.gmail.com>
	<4EFCA605-80FE-4D6F-90CE-C124984C95AB@pilhuhn.de>
	<CABWW-d0A73dsyfu44gJ5o2K1bHHxAUXWWsrCGTnj779QamK1gA@mail.gmail.com>
	<52677946.4090907@hogranch.com>
	<C4280E84-5DC2-47E1-B87B-F2A7E681EB3D@gmail.com>
	<283F612E-688B-4342-A924-EF67EF86A20A@gmail.com>
	<30D0DB98-4224-425A-B99B-C4BF5CBC30AB@gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 23.10.2013 21:04, Steven Schlansker wrote:
>
> On Oct 23, 2013, at 10:58 AM, Adib Saikali<adib.saikali@gmail.com>  wrote:
>
>> Seems to me that PhantomReferences can solve this problem as they will provide the ability to the cleanup without causing the performance issues with the finalizers. I am not familiar with the postgres jdbc driver code base so I have no idea how much work is involved in switching from finalizers to phantom references.
>>
>> Can anyone with knowledge of the jdbc code base comment on the practicality of moving from finalizers to phantom reference.
>
> Do we in fact know that phantom (or weak?) references are cheaper than Finalizers?

Well, we *already* use phantom references to clean up server-side 
resources in the SimpleQuery and Portal classes. I think that's actually 
already enough to avoid server-side resource leaks if an application 
neglects to close Statements.

Rather than discussing what might be the best way to use finalizers or 
phantom references to replace the current finalizer in the Statement 
class, I wish someone would just try to remove it and see what happens.

- Heikki


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (26+ messages)  latest in thread

Message-ID: <526814C5.8060106@vmware.com>
Permalink:  ../526814C5.8060106@vmware.com/
Also on:    postgresql.org/message-id/526814C5.8060106@vmware.com

 · 

reply

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: hlinnakangas@vmware.com, stevenschlansker@gmail.com, adib.saikali@gmail.com
  Subject: Re: Remove usage of finalizers ?
  In-Reply-To: <526814C5.8060106@vmware.com>
  References: <9E5438C0-0A2E-4543-BE06-1E7A6D0E3B83@pilhuhn.de> <CABWW-d2rT-dGEh-hrtemgo2z6dm5H2VUz86y-xmgs3p_6Hv+_w@mail.gmail.com> <E177372F-3F90-4F1D-9A34-84B3A678A988@pilhuhn.de> <CABWW-d2EfWuCV7ZDGoWpz1GiFEM_zNX6rq1PHdHNm_HbZ3EM2w@mail.gmail.com> <B86EB807-F8DF-4F2A-BBC9-6CAB925FCDE9@pilhuhn.de> <CADK3HH+CaUF3gG-D3fTZn4OeKdP+39=iqgww1Wp7hYBiypKidg@mail.gmail.com> <CAPPfruy+mPWfg9WmWQGaRVTAQS9kBgF1pi9oJB4ZcgRyZ87few@mail.gmail.com> <CABWW-d1iMgM9-fs2uJ2Vk5rTQnN29nvUvfhQUg0k=jxao-T_KA@mail.gmail.com> <4EFCA605-80FE-4D6F-90CE-C124984C95AB@pilhuhn.de> <CABWW-d0A73dsyfu44gJ5o2K1bHHxAUXWWsrCGTnj779QamK1gA@mail.gmail.com> <52677946.4090907@hogranch.com> <C4280E84-5DC2-47E1-B87B-F2A7E681EB3D@gmail.com> <283F612E-688B-4342-A924-EF67EF86A20A@gmail.com> <30D0DB98-4224-425A-B99B-C4BF5CBC30AB@gmail.com> <526814C5.8060106@vmware.com>

* 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