A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-February/002370.html below:

[Python-Dev] tracking memory consumption

[Python-Dev] tracking memory consumption [Python-Dev] tracking memory consumptionMartin von Loewis loewis@informatik.hu-berlin.de
Tue, 29 Feb 2000 16:43:11 +0100
> > In PR#214 Martin v. Loewis suggests a sizeof function as result of
> > request to python-help.  I've followed the thread silently until now.
> 
> For such basic computations of the native objects sizes, struct.calcsize
> is your friend.

Unfortunately, it does not work in the general case, or I'm missing
something: Given

>>> a={}
>>> for i in range(1,10):
...   a[i]=i*i
... 

how exactly do you find out the size occupied by a? I don't want to
count the size of the keys and values themselves - just the memory
used by the storage of the references to the keys and the values.

Regards,
Martin



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4