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.
"Jarvis" wrote:
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!