Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Minimizing form increases avail memory - a lot 1

Status
Not open for further replies.

mrdance

Programmer
Apr 17, 2001
308
SE
I have an application which takes about 54 MB after being loaded. When I minimize it and then maximize it it goes down to 12 MB and stays there.

Why is this happening? I have tried to run GC.Collect after loading the form but it does not change the memory. Is there anything I can do so that the taken memory decrease to 12 MB like when I minimized/maximized it?

thanks!

--- neteject.com - Internet Solutions ---
 
Don't panic! This is designed behavior.

When the OS loads an application, it tries to anticipate memory needs -- erring on using the surplus which it has laying around unused. Once you minimize the app, the OS is tipped that the app really has a smaller "footprint" than anticipated -- thus the decrease.

I don't know the best way to simulate this in code, off-hand. And, I'm not even sure it is advisable to do it. Anyway, unused pages will get recycled when another app needs them, and when they are not being swapped to disk (virtual memory).

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top