Hello Heisenberg: Memory Profiling Changes App Behavior
mjpeet
Posts: 4
I am currently stress testing a long-running (Windows service) application trying to find memory leaks. What I have done up to this point was run the Windows Performance Monitor with a few key metrics, including Generation 2 Heap Size. After running the app all weekend I noticed that this counter had grown beyond my comfort zone, so I decided to profile it with ANTS.
What I have noticed is that the Gen 2 Heap Size doesn't seem to grow as it does when the app isn't being profiled. Can anyone think of an explanation?
Windows XP Professional SP 2
.NET Framework 1.1
Dell Optiplex GX620
2.8 GHz PROCESSOR (80551, Pentium D Smithfield for desktops)
1 GB RAM
Thanks in advance,
Mike
What I have noticed is that the Gen 2 Heap Size doesn't seem to grow as it does when the app isn't being profiled. Can anyone think of an explanation?
Windows XP Professional SP 2
.NET Framework 1.1
Dell Optiplex GX620
2.8 GHz PROCESSOR (80551, Pentium D Smithfield for desktops)
1 GB RAM
Thanks in advance,
Mike
Comments
Mike
I have noticed that the Garbage Collector seems much more active when the app is being profiled. Why is this?
Mike
I'm really pleased to hear that ANTS profiler really helped you track down that memory leak. I'd be really interested to hear the details so that we could write up a case study. If this is something that would be of interest, just send a mail through to support@redgate.com. We'd happily give you some free software in return for your effort
I look forward to hearing from you.
Best regards,
Tom Harris
Red Gate Software
The VM size grows and grows and the service processes a flow of data from an MSMQ. When I turned ANTS profiler on for this service, however, the VM size became bounded at around 45MB, where it had grown over 100MB without the profiler. The number of objects also stabilizes.
I did a little digging and thought it may be because of the forced GC that the profiler does before capturing a snapshot. But even with my addition of a call to the GC to Collect, my memory still grows when I'm not profiling. I'm baffled but I certainly don't understand .NET garbage collection backwards and forwards yet. Just wanted some help understanding why the profiler might be behaving in this way.
I'm running the ANTS 2.7.0.109 free trial. On Windows XP SP2 on a Compaq laptop.