[Numpy-discussion] how do I delete unused matrix to save the memory?

Vagabond_Aero vagabondaero at gmail.com
Tue Dec 9 21:40:15 EST 2008


I have the same problem.  I tried the del command below, but foundon that it
removes the names of the ndarrays from memory, but does not free up the
memory on my XP system (python 2.5.2, numpy 1.2.1).  Regular python objects
release their memory when I use the del command, but it looks like the
ndarray objects do not.

On Mon, Dec 8, 2008 at 22:00, Travis Vaught <travis at enthought.com> wrote:

> Try:
>
> del(myvariable)
>
> Travis
>
> On Dec 8, 2008, at 7:15 PM, frank wang <f.yw at hotmail.com> 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.
>
> Thanks
>
> Frank
>
> ------------------------------
> Send e-mail faster without improving your typing skills. Get your Hotmail(R)
> account.<http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081209/1f47826b/attachment.html>


More information about the NumPy-Discussion mailing list