Memory Leak, windows form wrapping unmanaged object

G

Guest

Hello All,

We have developed a windoes application, in one of the forms we are using an
activeX control xpdfviewer (http://www.glyphandcog.com/XpdfViewer.html).

I was looking at memory usage using the scitech memory
profiler(http://memprofiler.com/), i found that even after the form
containing that activeX control is closed, a live instance of the form is
showing, but when i try to get the details of it, it says this instance has
been disposed. I think its a potential memory leak issue.

Can any one please suggest, how to overcome this issue, may be using
finalizers to clean up the unmanage code properly. Any pointers will be
helpful.

Thanks,
Vinay Kant
 
M

Mehdi

We have developed a windoes application, in one of the forms we are using an
activeX control xpdfviewer (http://www.glyphandcog.com/XpdfViewer.html).

I was looking at memory usage using the scitech memory
profiler(http://memprofiler.com/), i found that even after the form
containing that activeX control is closed, a live instance of the form is
showing, but when i try to get the details of it, it says this instance has
been disposed. I think its a potential memory leak issue.

Can any one please suggest, how to overcome this issue, may be using
finalizers to clean up the unmanage code properly. Any pointers will be
helpful.

The form has been disposed so everything seems fine. If the form is not
referenced anywhere anymore, the Garbage Collector will come at a later
stage to reclaim the memory used by the form (it can take a while for the
GC to do that since as long as there is enough memory available, there is
no need for the GC to waste time trying to free up some more memory). If
your unmanaged component provides a method that you can call to clean up
once you're done with it, you should call this method in the Dispose()
method of your form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top