lua-users home
lua-l archive

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


On Wed, 27 Oct 2010 04:45:32 +0300, Alex de Magalhães Machado <alex@lisha.ufsc.br> wrote:

I really think it could be someone's thesis to make useful, but right now
I'm just worried about assuring predictability.

If you can say it has a quadratic performance, then you can predict the
garbage collection execution time (e.g. you can consider it always has
quadratic time).

It's from this paper, a very good read on Lua GC:
http://www.inf.puc-rio.br/~roberto/docs/ry08-06.pdf

Using this time and taking into account other variables,
developers can determine a worst case execution time for each one of their applications, and that is hard real time, even if it's not high performance.
So, are these corner cases predictable?

Most corner cases are either from ephemerons (tables with weak keys),
or from userdata finalization (which is done in a delayed fashion and
can release additional resources, so that running full GC cycle does
not guarantee that all garbage gets collected)

If the script is short lived, and turning GC completely off is
an acceptable option, it's the most predictable way. It is possible then to
run full GC manually at known times.