Python dictionary size/entry limit?

"Martin v. Löwis" martin at v.loewis.de
Wed Feb 25 15:19:41 EST 2009


>> On a 32-bit system, the dictionary can have up to 2**31 slots,
>> meaning that the maximum number of keys is slightly smaller
>> (about 2**30).
> 
> Which, in practice, means that the size is limited by the available memory.

Right. Each slot takes 12 bytes, so the storage for the slots alone
would consume all available address space.

>From that point of view, you can't possibly have more than 314M slots
in a 32-bit address space (roughly 2**28).

Regards,
Martin



More information about the Python-list mailing list