gc.setthreshold()?

Neil Schemenauer nas at python.ca
Tue Apr 17 14:53:49 EDT 2001


Jay Collins wrote:
> gc.set_threshold(1,2,3)

This means collect the youngest generation of objects every time
one net new object is allocated.  Collect the second generation
every two times the youngest generation is collected and collect
the oldest generation every three times the second oldest is
collected.  Probably not a optimal setting.

The defaults are 700, 10, and 10.  Those numbers were selected
without doing a large amount of testing.  It is conceivable that
they are not optimal for some applications.  set_threshold
allows tuning.

> I got all kinds of neato output that I have no idea what it
> does. 

It doesn't do much by itself.  Its moderately useful if you want
to know what the collector is doing.  If you want to know what it
means ask me specific questions.

  Neil




More information about the Python-list mailing list