* "Rob Panosh" <ro************************@asdsoftadfdware.com> scripsit:
I have a small VB.Net application that instantiates many objects (about
200), when I look at task manager the application is using about 50 meg.
Now if I minimize the window then restore it the memory usage goes down to
about 8 meg then after a while it will go up to about 15 meg. Does anybody
know why the app behaves this way and how I can make my application only use
8 to 10 meg, as it does when minimized, at startup?
This behavior is not specific to .NET applications only.
It is a feature of the Windows/Explorer shell.
If an application is minimized, Windows removes the working set memory from
the application by calling the Win32 function 'SetProcessWorkingSetSize':
<http://msdn.microsoft.com/library/en-us/dllproc/base/setprocessworkingsetsize.asp>
Windows supposes that minimized applications will not be used for some time
and this memory will be made available to other processes.
When restoring the window the application gets the memory back:
<http://support.microsoft.com/?kbid=293215>
This behavior is by design and it doesn't make sense to worry about
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
<http://www.plig.net/nnq/nquote.html>