DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Reduce Memory Footprint Of A .NET Application

06.02.2007
| 6501 views |
  • submit to reddit
        Don’t ask me anything. It just works :)

 try
{
Process process = Process.GetCurrentProcess();
process.MaxWorkingSet = loProcess.MaxWorkingSet;
process.Dispose();
}
catch { }

p.s. you can even make a timer that could run this piece of code periodically.