Re: Remove usage of finalizers ?

Поиск
Список
Период
Сортировка
От Steven Schlansker
Тема Re: Remove usage of finalizers ?
Дата
Msg-id C4280E84-5DC2-47E1-B87B-F2A7E681EB3D@gmail.com
обсуждение исходный текст
Ответ на Re: Remove usage of finalizers ?  (John R Pierce <pierce@hogranch.com>)
Ответы Re: Remove usage of finalizers ?
Список pgsql-jdbc
On Oct 23, 2013, at 12:22 AM, John R Pierce <pierce@hogranch.com> 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
anythingelse. 
>> You are saying that as in my incorrect application (and I am 95% sure you've got incorrect application if you are
gettingfinalizing objects piled up) it does not work, let's remove it altogether and make driver also wrong. 
>
> as an outsider to this stuff, with only a superficial understanding of these finalizers, it seems to me they should
loga warning if anything leaks to them.  you don't get rid of them entirely, they provide backup sweeping up of
neglecteddebris.. 
>

The specific problem with this is that the mere presence of a non-empty finalizer increases the cost of object
allocationand deallocation by orders of magnitude (as is claimed by many Java performance resources).  All correct
applicationspretty much have to deallocate these objects explicitly, as the GC can leave the resources lying around for
unboundedtime.  So having these finalizers penalizes the correct applications (which I have not observed in practice,
butOP 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
verifythat there aren't any other errors that might be contributing to this problem?  It seems that if the problem was
reallythat big, someone else would have run across it. 

Best,
Steven



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Remove usage of finalizers ?
Следующее
От: Adib Saikali
Дата:
Сообщение: Re: Remove usage of finalizers ?