Joined: 07 Feb 2013
|Posted: Thu Feb 07, 2013 4:44 pm Post subject: Take Snapshot clears memory leak
I am new to ANTS Memory Profiler.
I am trying to understand why my app runs at around 80MB but after my business logic runs it reports to be at 7.5GB in both the Task Manager and Resource Monitor. Taking a baseline snapshot before and then a comparison snapshot after fails to identify memory leak because it cleans up my apps memory during the snapshot somehow. Why?
Windows 2008 R2
.NET 4.0 Windows Service
Business Logic is:
Every 24 hours, create 1500 Tasks which create 1 HttpWebClient connection each, and saves the downloaded content to a file on disk.
- 1500 .NET Logical Threads (Tasks)
- 1500 HttpWebClient connections)
- 1500 files written to disk
All connections and file handles have Dispose() called on them
I attach ANTS Memory Profiler and take a snapshot at 80MB (baseline)
After business logic is finished executing the memory is at 7.5GB, 10,000 with page faults. Task Manager, Resource Monitor and ANT Memory Profiler all shows memory is way up at 7.5GB and this wil remain for ever (months) if I do not restart the service - eventually my machine becomes unresponsive (3 weeks).
I take a second Memory Snapshot, it reports 80MB, both Task Manager and Resource Monitor show drop from 7.5GB to 80MB at time of snapshot taken. This always happens when taking a snapshot, it clears the apps memory.
So my question is:
What is ANTS Memory Profiler doing to my app during a snapshot that causes the memory in my app to be cleaned up and hence no memory leak is reported?
Thanks for any help.