I have written a small WinForm application in C#. The EXE that is made is 74 Kb and all together with the resources and all it sizes 179 Kb. But when I run it, it takes 9.1 MBs in memory according to Task Manager.
So my question is:
- Why is it happening?
- What can I do to reduce the size of this?
- If the size could be reduced how much reduction is possible?
Firstly, using Task Manager to determine memory usage is fraught with peril. Have a read of this article to gain a clearer understanding of it.
For example:
All that said, 9.1Mb isn’t really a lot (less than 0.5% of memory on a machine spec’d with 2Gb of RAM) and more importantly, does it actually matter that your application’s using 9.1Mb of RAM, or are you wasting your time investigating? Remember, your time’s valuable. Would your end users rather the time was spent on something else? =)