T
ThunderMusic
Hi, is there an easy way to know how much memory an instance of an object
takes?
I mean, there is the sizeof(type), but this is not what I want... the
sizeof(type) returns the size of all the members of the class, but if the
class contains reference types like a collection or a string, it can't
tell...
What I need to know is, if there is a collection of strings, with each
strings taking 100kb and having 5 strings in the collection, I want to have
500kb (or approx) as a return... is there an easy, thread-safe way?
Thanks
ThunderMusic
btw, I'm using c# with framework 2.0
takes?
I mean, there is the sizeof(type), but this is not what I want... the
sizeof(type) returns the size of all the members of the class, but if the
class contains reference types like a collection or a string, it can't
tell...
What I need to know is, if there is a collection of strings, with each
strings taking 100kb and having 5 strings in the collection, I want to have
500kb (or approx) as a return... is there an easy, thread-safe way?
Thanks
ThunderMusic
btw, I'm using c# with framework 2.0