[Tutor] memory error files over 100MB

Kent Johnson kent37 at tds.net
Mon Mar 16 17:57:18 CET 2009


On Mon, Mar 16, 2009 at 12:30 PM, A.T.Hofkamp <a.t.hofkamp at tue.nl> wrote:

> I don't know what code is executed in an assignment exactly, but
> **possibly**, first the 'read()' is executed (thus loading a very big string
> into memory), before assigning the value to the variable (which releases the
> previous value of the variable).
> That means that just after reading but before assigning, you **may** have
> two very big strings in memory that cannot be garbage collected.

No. Python variables are references to values, not containers for
values. Python assignment is *always* reference assignment, not
copying of a value. More here;
http://personalpages.tds.net/~kent37/kk/00012.html

Kent


More information about the Tutor mailing list