lua-users home
lua-l archive

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


Enrico Colombini wrote:
Ralph Hempel wrote:
The current default garbage collector parameters request a doubling
of the current RAM usage when RAM runs out.

I may be wrong, but I interpret the manual description of 'pause' as meaning that the collector merely doubles the allocation threshold where a new collection will forcibly take place. I can't find sbrk() in the code.

Yes, you are correct. The call to sbrk() happens when your own heap gets
exhausted :-)

Anyway, as I said last week, I'm not sure I really understand how this mechanism works. To avoid the risk of memory overrun in an embedded system, I ended out checking allocation level periodically with 'count' and forcing a gc at a fixed threshold, then later checking it again (suggestions for a better way are welcome).

A tunable parameter for the garbage coellctor that either works the
way it currently does (as a percentage) or as an absolute value would
be in interesting compromise.

Ralph