Deleting objects on the fly

Steve Holden steve at holdenweb.com
Sat Aug 11 10:10:53 EDT 2007


Dustan wrote:
> On Aug 10, 1:49 pm, "Terry Reedy" <tjre... at udel.edu> wrote:
>> "Campbell Barton" <cbar... at metavr.com> wrote in message
>>
>> news:46BC35F2.4070600 at metavr.com...| Michele Simionato wrote:
>>
>> | > Probably not, 'del x' just decrements the reference count,
>>
>> Or ashttp://docs.python.org/ref/del.html
>> puts it, " Deletion of a name removes the binding of that name from the
>> local or global namespace,"
>>
>> | del x will remove x from memory if nothing else is refering to it,
>>
>> This is implementation dependent: true for CPython, not for Jython, ??? for
>> IronPython.
> 
> Wait a second; do you mean to say that in Jython, del x will never
> remove x from memory? How do you free up RAM?
> 
Because the exact method of garbage collection is independent of the 
language definition, Jython uses the Java garbage collector, which works 
(approximately) as follows.

In that language memory is allocated until a request cannot be 
satisfies, then a scan is performed for unreferenced objects whose space 
is reclaimed. Only if this doesn't yield enough space to allocate the 
new object is more memory requested from the OS by the process.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------




More information about the Python-list mailing list