Re: Memory not released
- From: Markus <difh04-gen1REMOVE@xxxxxxxxxxxx>
- Date: Thu, 24 Aug 2006 13:01:19 +0200
Petri wrote:
Can someone explain what I understood wrong.
I thought that the Framwork garbage collection takes care of the memory management in a DotNet application.
I have however an application that keeps eating up memory and not releasing it, to the point where all the resources of the computer are consumed.
Example, I open up a MDI child windows that has all kinds of object. When I monitor this in Task Manager, I can see that the amount of memory my application is consuming increases when the window is opened, but when I dispose the window tha amount is not decreased.
Where did I go wrong. As far as I can tell the application uses only managed resources nad dataconnections to SQL server
- First of all, do not fully trust the TaskManager, rather use perfmon
(Start -> Run -> perfmon), and add a new Performance Monitor for your
Application, watching "Private Bytes" (and maybe some others).
This is by far correcter.
- Second: If you hold a reference to a resource, then it cannot be
disposed/garbage collected. So be sure, that you really get rid of
the references to your resources, and use disposed, when the
documentation wants you to use it, as behind the scene there might
be accessed some unmanaged resources.
hth
Markus
.
- Prev by Date: Re: Value not Change !
- Next by Date: Re: cache problem for StreamReader
- Previous by thread: Re: Value not Change !
- Next by thread: Re: Memory not released
- Index(es):
Relevant Pages
|