Memory management Question.

R

Rob Panosh

Hello,

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?

Thanks,
Rob Panosh
Advanced Software Designs.
 
H

Herfried K. Wagner [MVP]

* "Rob Panosh said:
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>
 
O

One Handed Man

Good Reply Herfried,

I didnt know that !

OHM



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/setprocessworkingsetsi
ze.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
 

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

Similar Threads


Top