From: | Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> |
---|---|
To: | Steven Schlansker <stevenschlansker(at)gmail(dot)com> |
Cc: | Adib Saikali <adib(dot)saikali(at)gmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Remove usage of finalizers ? |
Date: | 2013-10-23 18:26:13 |
Message-ID: | 526814C5.8060106@vmware.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
On 23.10.2013 21:04, Steven Schlansker wrote:
>
> On Oct 23, 2013, at 10:58 AM, Adib Saikali<adib(dot)saikali(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Vitalii Tymchyshyn | 2013-10-24 12:49:39 | Re: Remove usage of finalizers ? |
Previous Message | Steven Schlansker | 2013-10-23 18:04:39 | Re: Remove usage of finalizers ? |