Size of an object in memory?
fperez528 at yahoo.com
Wed Nov 14 16:25:11 CET 2001
Michael Hudson wrote:
> Fernando Pérez <fperez528 at yahoo.com> writes:
>> Is there any way (at runtime, dynamically) to obtain the size in
>> bytes of a given object in memory?
> Didn't we do this a few days ago? See this thread:
> but, in short, no, and you don't really want to know.
Sorry to bug, but I'm new to the list and I'm not sure which thread you're
talking about. If I hit the link you provide I get a blank in google. Could
you repost the correct link if you have it handy?
>> Since multiple names may be bound to the same object, is it possible
>> to obtain the size of the underlying object and a list of all other
>> names bound to it?
> Not easily. Or maybe not at all. Oh, hang on: see gc.get_referents.
> This may be new in Python 2.2, though.
Thanks for the tip. I'll look into it when I get 2.2 on.
More information about the Python-list