How to find size of Hashtable

  • Thread starter Thread starter Manish Jain
  • Start date Start date
M

Manish Jain

Platform: C# (Windows Application)/XP/Framework 1.1
-----------------------------------------------------------

Hi

I am doing some performance checks, I am using a hashtable that I suspect is
not implemented effeciently.

Can someone tell me how I can find the size of memory occupied by the
hashTable?

Infact I would be glad if I can know the size of any object in general.

Thanks and Regards

Manish
 
Hi Manish,

It depends of what you think mean with the size, it's the size of the heap
memory to instantiate it or it also include the size of those objects
created by reference, aka that lives in another place in the heap?

If an object , as is the case of Hashtable, contains references types like
a Collection then these is not enough to know the size of the Hashtable
itself but you have to add it the size of the Collection too.

I don't think that there is a way to do this on the framework, you would
need some tool, I recall that once I used a Memory profiling tool for .NET I
dont remember the name now, you have to look in the archives of this NG.


Hope this help,
 
CLR Profiler from MS may help

Ignacio Machin ( .NET/ C# MVP ) said:
Hi Manish,

It depends of what you think mean with the size, it's the size of the heap
memory to instantiate it or it also include the size of those objects
created by reference, aka that lives in another place in the heap?

If an object , as is the case of Hashtable, contains references types like
a Collection then these is not enough to know the size of the Hashtable
itself but you have to add it the size of the Collection too.

I don't think that there is a way to do this on the framework, you would
need some tool, I recall that once I used a Memory profiling tool for .NET I
dont remember the name now, you have to look in the archives of this NG.


Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

suspect
 
Back
Top