large Memory used in .NET application
-
Hi, try this with Windows XP or Window 2000: 1) create new windows application project. 2) Start debug. 3) press ctrl + Alt + Delete 4) Task manager 5) view the memory used by you application, it is 11 Mb. And if you add a simple dbconnection with dataadatper the memory used is ~24Mb. Is there a way to reduce the memory used by the application? In my application with simple 5 form it use 75 Mb of memory. It is too much.:(:confused: Max
-
Hi, try this with Windows XP or Window 2000: 1) create new windows application project. 2) Start debug. 3) press ctrl + Alt + Delete 4) Task manager 5) view the memory used by you application, it is 11 Mb. And if you add a simple dbconnection with dataadatper the memory used is ~24Mb. Is there a way to reduce the memory used by the application? In my application with simple 5 form it use 75 Mb of memory. It is too much.:(:confused: Max
The task manager shows your working set, which isn't the same as the memory load of your process. The .NET Framework is included in that lot, as well as anything else which happens to be shared. Try pview for more accurate stats. -- Ian Darling
-
Hi, try this with Windows XP or Window 2000: 1) create new windows application project. 2) Start debug. 3) press ctrl + Alt + Delete 4) Task manager 5) view the memory used by you application, it is 11 Mb. And if you add a simple dbconnection with dataadatper the memory used is ~24Mb. Is there a way to reduce the memory used by the application? In my application with simple 5 form it use 75 Mb of memory. It is too much.:(:confused: Max
Contrary to popular belief, automaticall memory management in .Net is not equivalent to 100% total resource clean up. Coders still have the responsability of freeing some resources through the Dispose() method. Use dispose whenever available if you want to reduce memory footprint and avoid thoses cases where Net programs' memory usage continuously grows over time. (A five form program should never reach 75 Mb (unless it deals with very large quantities of data like uncompressed 20MB+ images) if coding practices are good. Also, try minimizing the form in your example and see how much memory it is using (much less). This happens because at startup your program is assigned a large working set to account for any initialization the CLR and associated dlls might need.