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
 

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

Similar Threads

Hashtable 1
about the hashtable and equals 11
using hashtables 11
Hashtable question 4
Hashtable memory usage 2
Any benefit for fixed size hashtable? 8
LINQ, Hashtables and Business Layer 3
Hashtable ordering 5

Back
Top