Memory leak when looking .flags
Hi, I'm not sure this is the right mailing list for this, but it seems there's a memory leak when looking at flags :
from numpy import * x=ones(50000000) #==> python use 25% of memory (ok) del x #==> memory usage fall back to almost zero (as seen in top) Thqt's good.
but if I look at flags before the del :
x=ones(50000000) x.flags C_CONTIGUOUS : True F_CONTIGUOUS : True OWNDATA : True WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False del x who()
Upper bound on total bytes = 0 That looks nice, but the memory usage by python (in top) is still 25%... Isn't it a bug ? Cheers Cyrille Rosset.
Cyrille Rosset wrote:
Hi,
I'm not sure this is the right mailing list for this, but it seems there's a memory leak when looking at flags :
from numpy import * x=ones(50000000) #==> python use 25% of memory (ok) del x #==> memory usage fall back to almost zero (as seen in top) Thqt's good.
but if I look at flags before the del :
x=ones(50000000) x.flags C_CONTIGUOUS : True F_CONTIGUOUS : True OWNDATA : True WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False del x who()
Upper bound on total bytes = 0
That looks nice, but the memory usage by python (in top) is still 25%... Isn't it a bug ?
No, x.flags is still being stored in _. It still has a reference to x. Evaluate something else (e.g. ">>> 1") to clear that out and the memory should be released. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Ok, that works fine with python. But not in ipython... is there some other trick ? (there's a whole collection of _* variables in there...) Cyrille. Robert Kern a écrit :
Cyrille Rosset wrote:
Hi,
I'm not sure this is the right mailing list for this, but it seems there's a memory leak when looking at flags :
from numpy import * x=ones(50000000) #==> python use 25% of memory (ok) del x #==> memory usage fall back to almost zero (as seen in top) Thqt's good.
but if I look at flags before the del :
x=ones(50000000) x.flags C_CONTIGUOUS : True F_CONTIGUOUS : True OWNDATA : True WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False del x who()
Upper bound on total bytes = 0
That looks nice, but the memory usage by python (in top) is still 25%... Isn't it a bug ?
No, x.flags is still being stored in _. It still has a reference to x. Evaluate something else (e.g. ">>> 1") to clear that out and the memory should be released.
Cyrille Rosset wrote:
Ok, that works fine with python. But not in ipython... is there some other trick ? (there's a whole collection of _* variables in there...)
And the Out[NN]'s, too. You should be able to del all of them: del Out[NN], _NN, _, __, ___ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Cyrille Rosset
-
Robert Kern