Memory...
-
I don't know if this affects C#, but it was pointed out to me that a .NET application uses huge amounts of memory. I was wondering if anyone could shed some light on this or send me some links on Memory Management? For example, create a new VB.NET Windows Forms project. Do NOT add any code to the Form. Run the program and look in the task manager under your Program Name. You'll notice probably about 8,000 - 12,000 kb of memory being used. Now, Minimize the Form and the Memory drops to 600 - 650kb!!! :omg: Restore the Form and now it only uses 1500 - 2000 Kb of Memory! What in the world is going on!? :wtf: Has anyone else noticed this? I have a feeling it has something to do with GDI and Painting but I am not sure.
-
I don't know if this affects C#, but it was pointed out to me that a .NET application uses huge amounts of memory. I was wondering if anyone could shed some light on this or send me some links on Memory Management? For example, create a new VB.NET Windows Forms project. Do NOT add any code to the Form. Run the program and look in the task manager under your Program Name. You'll notice probably about 8,000 - 12,000 kb of memory being used. Now, Minimize the Form and the Memory drops to 600 - 650kb!!! :omg: Restore the Form and now it only uses 1500 - 2000 Kb of Memory! What in the world is going on!? :wtf: Has anyone else noticed this? I have a feeling it has something to do with GDI and Painting but I am not sure.
It's nothing you have to worry about and just about everyone has noticed this. When your app is launched, you have the entire weight of the .NET Framework loaded behind it, taking up a bunch of RAM. When your app is minimized, a bunch of data and code is moved to the page file and out of RAM since it's not being used by a foreground process. When your app is maximized again, only the data and code that gets executed and referenced gets moved back into RAM and out of the page file. When the is being used and exercised, more data and code will get moved back into RAM while seldom used data and code gets moved back to the page file. It's that simple. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
It's nothing you have to worry about and just about everyone has noticed this. When your app is launched, you have the entire weight of the .NET Framework loaded behind it, taking up a bunch of RAM. When your app is minimized, a bunch of data and code is moved to the page file and out of RAM since it's not being used by a foreground process. When your app is maximized again, only the data and code that gets executed and referenced gets moved back into RAM and out of the page file. When the is being used and exercised, more data and code will get moved back into RAM while seldom used data and code gets moved back to the page file. It's that simple. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Rage - do you happen to know if, in a System Tray application, the memory remains allocated? Looking at the Task Mgr, it seems that my fairly simple app is sucking 12MB while the icon just sits there. Thanks! Hal in AZ
-
Rage - do you happen to know if, in a System Tray application, the memory remains allocated? Looking at the Task Mgr, it seems that my fairly simple app is sucking 12MB while the icon just sits there. Thanks! Hal in AZ
Same thing. When the .NET Framework detects Windows getting low on memory, it'll start swapping things to the pagefile as needed. No! You're application will NOT hold onto 12MB of physical RAM while it's idling AND the system needs memory. If Windows can afford to let an application be a hog for awhile, it will. When memory starts to run low, the .NET Framework will start tightening its belt. Until then, there's no reason why your application and the Framework can't stay in memory. It helps with performnace if there is no page swapping going on. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Same thing. When the .NET Framework detects Windows getting low on memory, it'll start swapping things to the pagefile as needed. No! You're application will NOT hold onto 12MB of physical RAM while it's idling AND the system needs memory. If Windows can afford to let an application be a hog for awhile, it will. When memory starts to run low, the .NET Framework will start tightening its belt. Until then, there's no reason why your application and the Framework can't stay in memory. It helps with performnace if there is no page swapping going on. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks Dave! That makes it less painful. Hal in AZ