lua-users home
lua-l archive

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


> Maybe if I had more RAM (like a normal desktop computer), the problem
> wouldn't appear. But is this the way the GC is working? Does it use any
> kind of recursion? Or any large stack buffers?

The GC doen't use any kind of explicit recursion nor large stack
buffers. It is written assuming a restricted stack.  But some obscure
behavior may create recursive calls. Is it possible for your allocator
to fail when shrinking a memory block?

Any memory-allocation fail may trigger an "emergency collection".
During a GC cycle (finalizers are out of this story), Lua never
allocates new memory, but it may shrink some structures. If
shrinking fails (what Lua assumes should not happen), the emergency
collection will start a new collection, which will fail again,
creating a recursive loop.

But there may be other scenarios that I am not seeing.

Is it possible to have at least some estimate for the number of function
calls in the stack?

-- Roberto