getting MemoryError with dicts; suspect memory fragmentation

dmtr dchichkov at gmail.com
Thu Jun 3 19:41:47 EDT 2010


On Jun 3, 3:43 pm, "Emin.shopper Martinian.shopper"
<emin.shop... at gmail.com> wrote:
> Dear Experts,
>
> I am getting a MemoryError when creating a dict in a long running
> process and suspect this is due to memory fragmentation. Any
> suggestions would be welcome. Full details of the problem are below.
>
> I have a long running processing which eventually dies to a
> MemoryError exception. When it dies, it is using roughly 900 MB on a 4
> GB Windows XP machine running Python 2.5.4. If I do "import pdb;

Are you sure you have enough memory available?
Dict memory usage can jump x2 during re-balancing.

-- Dmitry

P.S. Wish there was a google-sparsehash port for python....



More information about the Python-list mailing list