About memory usage

G

Guest

I've made a testing program to test the memory usage of some Data Forms.
I create a MDI parent form with one single MDI child form, which is a Data
Form generated by .NET Data Form Wizard.

To test the stuff, I keep to open that child data form for about 10 times.
the memory usage shown in GC and task manager both increase.

Then I close all those forms. and perform GC collect. The memory usage shown
in GC falls, however, the memory usage shown in task manager keeps unchanged.

May I know if there's any method I could really release the memory used?
what exactly cache or unreleased in the memory? DataSet?

Need help. Thanks!
 
C

Cor Ligthert

Jarvis,

When you will search these dotNet newsgroups you will see thousands of
messages which say, don't look at your taskmanager for your memory because
that does not give the right information.

Than on your and others next question "How can I manage my own memory?.
There are long threads of messages, which ends mostly with "Don't bother
about it, because that is the reason it is managed code".

I hope this helps,

Cor
 
G

Guest

The Task Manager mem usage has been one of the most misunderstood elements of
Windows for years and years. The mem usage (or "working set" I believe) says
nothing about how much memory a program is actually using... only how much
memory Windows is currently allotting to it in RAM. This can shrink and grow
as windows pages things in and out of memory. The program could be using 2k
of 10mb that Windows has given it. If Windows needs that memory back it'll
just shrink or swap out part of the set.... and vice versa.

When a program first loads it in essense requests a block of memory. Some
programs (compiled with the "tiny" directives in C++) request less. Others
request more. In addition the dll's loaded up may request additional storage
also. But, it doesn't mean they actually use it. In fact, most of the time,
they don't. And if they need "more" Windows gives it to them by taking it
away (swapping it out) from other programs or shrinking the disk cache.
 

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