#4631: possible memory leak in matrix code?
------------------------+---------------------------------------------------
Reporter: craigcitro | Owner: mabshoff
Type: defect | Status: new
Priority: major | Milestone: sage-3.2.2
Component: memleak | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Comment (by mabshoff):
This may be relevant here. Either way it warrants consideration to call
%reset at the end of Sage, but that would be another ticket.
{{{
On Mon, Dec 8, 2008 at 19:15, frank wang <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have a program with some variables consume a lot of memory. The
first time
> > I run it, it is fine. The second time I run it, I will get
MemoryError. If I
> > close the ipython and reopen it again, then I can run the program
once. I am
> > looking for a command to delete the intermediate variable once it is
not
> > used to save memory like in matlab clear command.
How are you running this program? Be aware that IPython may be holding
on to objects and preventing them from being deallocated. For example:
In [7]: !cat memtest.py
class A(object):
def __del__(self):
print 'Deleting %r' % self
a = A()
In [8]: %run memtest.py
In [9]: %run memtest.py
In [10]: %run memtest.py
In [11]: del a
In [12]:
Do you really want to exit ([y]/n)?
$ python memtest.py
Deleting <__main__.A object at 0x915ab0>
You can remove some of these references with %reset and maybe a
gc.collect() for good measure.
In [1]: %run memtest
In [2]: %run memtest
In [3]: %run memtest
In [4]: %reset
Once deleted, variables cannot be recovered. Proceed (y/[n])? y
Deleting <__main__.A object at 0xf3e950>
Deleting <__main__.A object at 0xf3e6d0>
Deleting <__main__.A object at 0xf3e930>
-- 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
_______________________________________________
Numpy-discussion mailing list [EMAIL PROTECTED]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4631#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---