Robert Klemme
3/6/2007 8:20:00 AM
On 06.03.2007 08:40, Wes Gamble wrote:
> I'd like to be able to estimate how much memory a given object requires.
> What is the best/easiest way to do this? One thing that occurred to me
> was the Marshal.dump the object to a file and look at that, although
> looking at a textual representation of the object could be significantly
> larger (I think).
Marshal doesn't text - the output is binary. But there's another
problem: what do you regard an object's size? Is it just the instance?
Is it the instance plus certain members like Arrays, Strings and
numbers? Is it the whole graph of objects reachable from your object?
In any case how do you deal with aliasing, i.e. objects referenced by
more than one object? etc.
Kind regards
robert