Memory problem

Peter Otten __peter__ at
Thu Nov 15 14:10:06 CET 2007

Rolf Wester wrote:

> Diez B. Roggisch wrote:
>> Rolf Wester wrote:

>>> I have a strange (for me) memory problem. When running a loop in a
>>> Python program memory usage increases from about 4% up to 100%. I do a
>>> gc.collect() every loop cycle but this doesn't help. There are about
>>> 67000 objects that are tracked by the garbage collector. This number
>>> does vary a little bit but does not increase on average whereas the
>>> memory usage does. The number of garbage objects (len(gc.garbage()) is
>>> zero. This is a very severe problem for my application, so I would be
>>> very appreciative for any help.
>> well, it might be that the relative moon humidity resonates with the
>> loop-cycle, creating quantum-flux in the main memory banks.

> Sorry, of course your are wright. I'm running Python2.5 on Linux, my 
> program imports numpy, matplotlib, sys and a python module of my own.
> This module uses numpy and scipy.weave for imbedded C-code but no 
> extension modules. I though the code to be to large to show, I hoped you 
> could give me hint on what I could try.

I think it is now safe to say that the embedded C code is a more likely
culprit than the relative humidity of the moon...

If you have python prototypes for the C chunks you could temporarily put
them back in. Otherwise it is time to start stripping down the code until
you can isolate the problem -- or at least have something you can post


More information about the Python-list mailing list