Finding Memory Used?

S

Sean

I'm trying to find out the amount of memory used by a data
structure (Hashtable) in a program.
If I look at the values for "Mem Usage" and "VM Size"
under the processes tab in the Windows Task manager, the
size increase seems to alot greater than if I just add up
the key and the element (i.e. Key and Value are Integers =
4 bytes*2 = 8 bytes per rec, * 1,000,000 ~ 8MB).
 
N

Nicholas Paldino [.NET/C# MVP]

Sean,

You will need to get some sort of profiler to do this. Just looking at
the memory consumed by the process doesn't work because of the fact that the
CLR is a memory-managed system. The CLR will allocate more memory for the
process as time goes on.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top