I had created a program in C#. That program used about 60-70 MB of my memory. But when I minimized that program, it required less memory, that is, just 10 MB.
This article explains all:THE MEMORY MYSTERY
this is an extract from the above site:
.Net Urban Legend
It is possible to reduce the working set size of a .Net Windows Forms application by minimizing and then maximizing the application immediately after it loads. Windows OS trims the working set of applications when they are minimized. The memory that was briefly used while loading all those assemblies mentioned earlier is trimmed by the process of minimizing and maximizing the application. You can demonstrate this behavior to yourself by creating and running a Windows Forms application with just Form1 and no added code.
Create and run the simple application.
Open the Windows Task Manager and then its Processes Tab. You will see the Task Manager shows your application’s memory usage at approx. 12.5 MB.
Now minimize your application and then maximize it. Check the Task Manager again. You will see the Task Manager now shows your application’s memory usage at approx. 1.5 MB. The memory that was used to load assemblies when your application was launched was reclaimed by memory management when you minimized the application.
Did you improve memory management or application performance by minimizing and maximizing your application? No. You can find some .Net Windows programmers who add code to minimize and then maximize their programs thinking that they are optimizing memory. As these programmers have shared this technique with others a sort of .Net Urban Legend has been born – a programming practice based on fiction not fact. This practice is unnecessary because when OS needs the unused memory left behind when the assemblies were loaded it will reclaim it automatically. In fact, decreasing the size of your application’s working set when memory is plentiful may decrease performance.