"Help needed - I don't understand how Python manages memory"

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Apr 20 22:09:40 EDT 2008


En Sun, 20 Apr 2008 17:19:43 -0300, sturlamolden <sturlamolden at yahoo.no> escribió:

> On Apr 20, 9:09 pm, "Hank @ITGroup" <hank.info... at gmail.com> wrote:
>
>> Could you please give us some clear clues to obviously call python to
>> free memory. We want to control its gc operation handily as we were
>> using J**A.
>
> If you want to get rid of a Python object, the only way to do that is
> to get rid of every reference to the object. This is no different from
> Java.
>
> If you just want to deallocate and allocate memory to store text,
> Python lets you do that the same way as C:

I'm not sure if this will help the OP at all - going into a world of dangling pointers, keeping track of ownership, releasing memory by hand... One of the good things of Python is automatic memory management. Ensuring that all references to an object are released (the standard Python way) is FAR easier than doing all that by hand.

-- 
Gabriel Genellina




More information about the Python-list mailing list