Python server locks up

M.-A. Lemburg mal at
Mon Sep 14 15:10:30 CEST 2009

Zac Burns wrote:
> I have a server running Python 2.6x64 which after running for about a
> month decides to lock up and become unresponsive to all threads for
> several minutes at a time. While it is locked up Python proceeds to
> consume large amounts of continually increasing memory.
> The basic function of the server is to serve a large dictionary -
> somewhat like a database. I have a couple theories as to why it locks
> up, but I'm not sure how to test them.
> Theories:
>    Python is resizing the large dictionary
>    Python is garbage collecting
> How would you suggest to figure out what is the problem?

Enable process core dumps and then kill the process.

Using a debugger you should be able to find out what caused the hang.

If you're serving a dictionary, I'd suggest using a different
approach: keep the dictionary on disk instead of in memory.

mxBeeBase will let you do that quite easily and is fast at
it as well:

It includes a tunable caching mechanism to keep the most often
requested data in memory.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Sep 14 2009)
>>> Python/Zope Consulting and Support ...
>>> mxODBC.Zope.Database.Adapter ...   
>>> mxODBC, mxDateTime, mxTextTools ...

::: Try our new mxODBC.Connect Python Database Interface for free ! :::: Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Python-list mailing list