Python not giving free memory back to the os get's me in real problems ...

Durumdara durumdara at gmail.com
Wed Apr 25 10:20:03 EDT 2007


Hi!

I got same problem with Lotus Domino + Python.
The lotus COM objects are not freed, so I get out from memory.

I solve this problem with a little trick:
I make two py applications. The first is call the second as like another
application.

The first is put some work to the seconds datadir.
 Whe second is finished with it, it is close itself.

Because the memory operations are existing in only the second script, all
memory get freed after it is finished, and the first (controller) py script
can call the next session without any problem.

dd

25 Apr 2007 07:08:42 -0700, leuchte at gmail.com <leuchte at gmail.com>:
>
> So I read quite a few things about this phenomenon in Python 2.4.x but
> I can hardly believe that there is really no solution to my problem.
>
> We use a commercial tool that has a macro functionality. These macros
> are written in python. So far nothing extraordinary.
>
> Our (python-)macro uses massively nested loops which are unfortunately
> necessary. These loops perform complex calculations in this commercial
> tool. To give you a quick overview how long this macros runs:
>
> The outer loop takes 5-7 hours for one cycle. Each cycle creates one
> outputfile. So we would like to perform 3-5 outer cycles en bloc.
> Unfortunately one of our computers (768MB RAM) crashes after just ~10%
> of the first cycle with the following error message:
>
> http://img2.freeimagehosting.net/uploads/7157b1dd7e.jpg
>
> while another computer (1GB RAM) crashes after ~10% of the fourth
> loop. While the virtual memory on the 1gb machine was full to the
> limit when it crashed the memory usage of the 768mb machine looked
> this this:
>
> http://img2.freeimagehosting.net/uploads/dd15127b7a.jpg
>
> The moment I close the application that launched the macro, my
> ressources get freed.
>
> So is there a way to free my memory inside my nested loops?
>
> thanks in advance,
> tim
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070425/0c096854/attachment.html>


More information about the Python-list mailing list