lua-users home
lua-l archive

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


Joshua Jensen wrote:

> The nature of Lua's growing of its internal arrays lends itself
> to fragmentation levels that aren't acceptable in a tight
> memory environment (such as a game console or embedded
> device).

In my project I gave up on using Lua in the "main loop" long ago and just
confined it to init time.  Even so it's much better than life-before-Lua.

Still, I'm interested in seeing how others manage in embedded and hard
real-time apps.  Have you considered keeping a separate heap for use by Lua?
This would localize the fragmentation and reduce its effect assuming Lua is
not allocating large blocks of memory such as for sound or animation data.
It's the mixing of the large and small blocks that makes fragmentation an
issue.

-John