performance - Find out how much memory is being used by an object in C#? -


does know of way find out how memory instance of object taking?

for example, if have instance of following object:

testclass tc = new testclass();

is there way find out how memory instance tc taking?

the reason asking, although c# has built in memory management, run issues not clearing instance of object (e.g. list keeps track of something).

there couple of reasonably memory profilers (e.g. ants profiler) in multi-threaded environment pretty hard figure out belongs where, tools.

if not trying in code itself, i'm assuming based on ants reference, try taking @ clrprofiler (currently v2.0). it's free , if don't mind rather simplistic ui, can provide valuable information. give in-depth overview of kinds of stats. used while 1 tool finding memory leek.

download here: http://www.microsoft.com/downloads/details.aspx?familyid=a362781c-3870-43be-8926-862b40aa0cd0&displaylang=en

if want in code, clr has profiling apis use. if find information in clrprofiler, since uses apis, should able in code too. more info here: http://msdn.microsoft.com/de-de/magazine/cc300553(en-us).aspx

(it's not cryptic using windbg, prepared mighty deep clr.)


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -