Dictionary in Python

Alex alex at somewhere.round.here
Mon Mar 13 22:00:16 CET 2000


> Order of magnitude, your hash table is taking around 20 Meg and your
> objects at *least* 75 Meg. If you've got the memory, it's still
> entirely possible your OS isn't giving it to you (ie, you're
> swapping).

That's possible, since I know very little about the operating system,
but according to "top" the python process is only using a third of the
machine's memory, and no other processes are using a significant
proportion.  Also, "kswapd" doesn't seem to be running when it slows
down... on linux, does that always run when swapping occurs?

> Order of magnitude, your hash table is taking around 20 Meg and your
> objects at *least* 75 Meg.

Wow, a string always takes at least 50 bytes?  The strings in question
are each 10 characters long.

Thanks for the info.  I'm going to have a look at how python decides to
resize the hash table.

Alex.



More information about the Python-list mailing list