lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Roberto Ierusalimschy wrote:
A big question that remains is how to control the pace of the collector.
If the collector runs to fast, it wastes time; if it runs too slow, it
wastes memory. Again, we need real data to better understand this point.

In my uneducated opinion it sounds like it needs to adapt its
collection rate according to instrumentation of the trends in gc
churn rate -- i.e. when it detects an increase in the rate
of collectable data (gathered from the amount of garbage collected
over the last few tries) it increases its collection rate
accordingly, then lowers its collection rate again down to a
nominal lower limit when it notices that the amount of garbage
collected over a period is falling.

Alternatively it could make collection rate be proportional
to object creation rate (though still with a lower limit on
rate).  That's probably simpler, but also assumes that objects
are mostly short-lived (a pretty good assumption?).

I don't know anything about the incremental collector, but a
heuristic for adapting along those lines sounds ideal to me.  As
you say, real data would definitely help; if 5.1work1 has some
instrumentation to log object lifetimes I'd be happy to run it
against my apps and submit the results.

Regards,
--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3