[Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2)

Antoine Pitrou solipsis at pitrou.net
Wed Dec 31 01:40:02 CET 2008


Jesus Cea <jcea <at> jcea.es> writes:
> 
> Mike Coleman wrote:
> > I guess if ints are 12 bytes (per Beazley's book, but not sure if that
> > still holds), then that would correspond to a 1GB reduction.
> 
> Python 2.6.1 (r261:67515, Dec 11 2008, 20:28:07)
> [GCC 4.2.3] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> sys.getsizeof(0)
> 12

On a 32-bit system, sure, but given Mike creates a 45 GB dict, he has a 64-bit
system, where ints are 24 bytes:

>>> sys.getsizeof(0)
24
>>> sys.getsizeof(100000)
24

cheers

Antoine.




More information about the Python-Dev mailing list