Free Memory

Ian Kelly ian.g.kelly at gmail.com
Thu May 8 23:48:48 EDT 2008


On Thu, May 8, 2008 at 6:30 PM, Dark Wind <darkwind.87 at gmail.com> wrote:
> Hi,
>
> How can I free all the memory in python by deleting all variables. I am
> looking for the equivalent of 'clear' from Matlab.
>
> I know del x deletes a variable x, but it doesn't free all the available
> memory.

I don't know if there's a good way to do exactly what you're asking
for.  However, if you really want to reset *everything*, you could
replace the current process with a fresh interpreter by calling
os.execlp("python").



More information about the Python-list mailing list