Re: Memory not released

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: OT:C/C++ Opinion Poll
    ... concerns itself with memory, while there are a lot of other resources whose lifetime need to managed as well. ... be able to separate memory allocation from resource lifetime management. ...
    (comp.arch.embedded)
  • Re: How come Ada isnt more popular?
    ... GC, everywhere, whereas it is useful only for memory. ... resources suffer from not having appropriate support. ... management of *everything else* and the result is either code bloat or more ... TextReader reader = new TextReader; ...
    (comp.lang.ada)
  • Resource Management Q.
    ... about resource classes and their so called "Management." ... Am I to understand that this is the process of shuffling resources ... and unload from memory), ... A resource assigned a low priority is removed ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: REGION=0M and LSQA
    ... At the time, memory was very expensive, and we ... remaining storage and always issued a return code zero. ... programs actually worked in production, ... all of the resources used by the job up until that point ...
    (bit.listserv.ibm-main)
  • Re: A realistic price comparison
    ... > Spreading Apple FUD is just as bad as spreading Microsoft FUD. ... > However, I assure you, I had more than enough resources on my XP ... > instilled in them by having limited memory and disk space early on. ...
    (comp.sys.mac.advocacy)