Python memory deallocate

bruno at modulix onurb at xiludom.gro
Thu May 11 18:35:44 CEST 2006


mardif wrote:
> In python 2.5 this was resolved, ok, but i can't use any python version
> then 2.3.5.
>
> This project was initializated with this version, and now it can be
> dangerous change version, even because I use McMillan installer for
> compile e build an executable.

Err... I'm sorry I don't understand your problem here. You don't plan on
sticking to 2.3.5 forever, aren't you ?

> So, my initial window is a "menu window", when i can choose, for
> example, upload foto for print, or create an object as PhotoAlbum.
> 
> If i'will choose PhotoAlbum, it will allocate 200Mb. well!  if i decide
> to abort this work, i will return to initial window. and if i will
> click in PhotoAlbum ago, the memory will increase to 350-400Mb.
> 
> It's that!!! I don't understand why!!! when i abort the work the first
> time, i call
> 
> app.Destroy()
> del app
> 
> Why Python ( or GarbageCollector, or.... ) don't deallocate memory??

*please* re-read carefully what I and Diez wrote earlier in this thread
before jumping to possibly erroneous conclusion. I didn't say that the
problem *actually* was with Python - just that it *may* have to do with
a memory management issue fixed in 2.5. And, while we're at it : your
application uses a GUI toolkit and does image manipulations, so the
problem can also come from one of these packages...

I also suggested that it may have to do with your code keeping
references to objects. del' an object just decrease the reference
counter - the object won't be freed until there are no more reference to
it *anywhere*.

If I was in your place, I'd *really* make sure the problem is not in my
code. Like, amongst other things, installing Python 2.5 and testing the
 program with it...


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list