Re: Remove usage of finalizers ?
От | Heikki Linnakangas |
---|---|
Тема | Re: Remove usage of finalizers ? |
Дата | |
Msg-id | 526814C5.8060106@vmware.com обсуждение исходный текст |
Ответ на | Re: Remove usage of finalizers ? (Steven Schlansker <stevenschlansker@gmail.com>) |
Список | pgsql-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 causingthe performance issues with the finalizers. I am not familiar with the postgres jdbc driver code base so I have noidea 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
В списке pgsql-jdbc по дате отправления: