[dba-Tech] .NET/Windows applications memory (leakage) and performance profilers

Gustav Brock gustav at cactus.dk
Sat Dec 27 10:39:06 CST 2014


Hi Shamil

Thanks for the useful info. I will certainly check this out when time comes. Right now other projects are busy.

/gustav

________________________________________
Fra: dba-tech-bounces at databaseadvisors.com <dba-tech-bounces at databaseadvisors.com> på vegne af Salakhetdinov Shamil <mcp2004 at mail.ru>
Sendt: 25. december 2014 19:11
Til: Discussion of Hardware and Software issues
Emne: Re: [dba-Tech] .NET/Windows applications memory (leakage) and performance profilers

 Hi Gustav --

No, ANTS Memory Profiler isn't a "magic" - it's a tool. :)
It collects a few stats on running application/windows service/web service/....
These stats are presented in user friendly form when 'Take Memory Snapshot' functionality is activated.
You can take as many snapshots as you wish.
The main stats are Namespace, Class Name, Live size (bytes), Size Diff (bytes +/-), LIve Instances, Instances diff (+/-).
'Diff' stats are calculated for currently taken snapshot against base snapshot.
You can filter the stats using different filters, you can sort stats' records etc.
It's all rather intuitive - I have immediately found the custom class(es), which caused memory leakage issue for my case after running the app for several minutes and taking a few snapshots. But to find where the object instances actually leaked was not immediately clear as they were leaking in the .NET base library class, which I used improperly - I have been creating for testing purposed detached temp new rows for System.DataTable without adding them to the table instance Rows collection and I wasn't aware that these rows, which aren't present in the System.DataTable Rows collection are actually created internally and are held in an internal array - forever - imagine that! And my table was created on a main form/custom control module level, so it was never disposed - meet memory leakage...

Collected stats on live object instances can be also categorized to see what instances is holding the others from garbage collection. These live references are presented as object diagrams you can navigate easily.


AFAIS  ANTS Memory Profiler has filter with 'Show only classes with source' checkbox but I don't know  how these sources should be used. ANTS Memory profiler doesn't have code reverse engineering functionality so I suppose it cannot pinpoint problematic code if you profile an app without source. And ANTS Performance Profiler does have code reverse engineering finctionality - so it can pinpoint performance bottle-necks even without source code - but this is another story.

You'd better try ANTS Memory Profile - trying it isn't time consuming - and AFAIS setup has small sample applications to play with and very good docs.

Thank you.

-- Shamil


Thu, 25 Dec 2014 14:02:30 +0000 from Gustav Brock <gustav at cactus.dk>:
>Hi Shamil
>
>Thanks for the info. It seems like the extra bucks on ANTS would be well spent.
>
>How far does ANTS go? Does it pinpoint the problematic code? Will it even suggest how to fix it?
>
>I'm a bit disappointed that VS2013 Ultimate was of no use.
>
>/gustav


More information about the dba-Tech mailing list