Page 1 of 1

Finalizer Queue

Posted: Mon 20 Feb 2017 20:01
by dhoenig
I'm hunting down a memory issue with one of our applications that uses devart dotconnect for oracle and I need some assistance. I'm using windbg to show me what's going on with the memory on the servers and I pulled up the finalizer queue and there are thousands of objects ready for finalization. Most of them are Devart.Data.Oracle.OracleConnection. Is this expected? We are calling close() and dispose() on the OracleConnection object, so why would they still need to be finalized? Shouldn't the finalizer be suppressed if we dispose of the the oracleConnection object?

Re: Finalizer Queue

Posted: Thu 23 Feb 2017 16:28
by Pinturiccio
Thank you for the provided information. We will investigate it and post here about the results as soon as possible.

Re: Finalizer Queue

Posted: Thu 09 Mar 2017 19:02
by dhoenig
Any updates on this?

Re: Finalizer Queue

Posted: Tue 14 Mar 2017 14:26
by Pinturiccio
OracleConnection is inherited from the System.ComponentModel.Component, which has a finalizer, and thus, is included to the finalizer queue.
The Dispose() method implementation of the Component class calls GC.SuppressFinalize(this), which excludes the component from the finalizer queue. Thus, if you call only Close() for OracleConnection, and don’t call Dispose(), in this case OracleConnection will stay in the finalizer queue. And if you call Dispose(), it will be excluded from the finalizer queue.

Probably there is a place in your code, where the Close method is called, and Dispose is not. Please check whether the Dispose method is called for every connection in your code.

Re: Finalizer Queue

Posted: Tue 14 Mar 2017 14:47
by dhoenig
Thank you for the information. I'll look through our code to make sure we are closing and disposing the connections properly.