lua-users home
lua-l archive

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


> > I've been gradually working my way through the papers at 
> > http://www.cs.utexas.edu/users/oops/papers.html and it 
> seems like, as 
> > noted in http://lua-users.org/wiki/LuaInRealTimePrograms,
> > someone just needs to crank out an implementation of 
> Wilson's garbage 
> > collector.
> 
> Such an incremental garbage collector will allow hard 
> real-time deadlines to be met, but will not solve 
> fragmentation issues.  These are separate problems.

Very true, but an incremental garbage collector sure would be awesome.

> Lua's memory use can be tuned to alleviate gc time and 
> fragmentation somewhat, as Joshua is doing.  However I 
> suspect that such tuning is hard to maintain and not always 
> effective.  For fragmentation, in an extreme case just one 
> byte allocated at the wrong time could result in megabytes of 
> unusable memory.

Yep, and this is the reason why Lua can't be used to its full potential
in a real-time application.  While I disliked removing some of the Lua
constructs from my scripts, the alternative is not that bad.  I get the
underlying power of Lua in a real-time app.  I just don't get to use
some constructs (such as anything that causes regular allocations in the
real-time loop).

But I wouldn't give it up, even with the restrictions.

Thanks,
Josh