memory

Karl Putland kputland at servicemagic.com
Fri Jan 28 16:21:30 EST 2000


----- Original Message -----
From: "Gerrit Holl" <gerrit.holl at pobox.com>
> Matt Cheselka wrote on 948999934:
> > Hi,
> >
> > Are there any issues with freeing memory in python?  Say for example I
do a
> >
> > d = array.array('i')
> > for i in range (2000):
> >     d.append(0)
> >
> > Do I need to free 'd' before I quit the program?
>
> Not necissary, but you _can_ do it with the del statement:
> del d
> removed the object and frees the memory.
>

Actually that just removes the binding to the name 'd'.
and the memory of d is not reclamed until later.

If something else is holding on to a reference of d the nothing is gained
save for cleaning up the namespace.

-Karl







More information about the Python-list mailing list