lua-users home
lua-l archive

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


A very generic solution is to write your own memory allocation
routines and pool small requests together into larger pages. I
haven't gotten around to writing one for my current project, but
there is a good example in the Nebula Device at Radon Labs:

	http://www.radonlabs.de/

Besides significantly reducing fragmentation, this also gives
a decent overall performance boost. Of course, this is more of
a workaround than a real solution.

Jason




John Belmonte wrote:
Such an incremental garbage collector will allow hard real-time deadlines to be met, but will not solve fragmentation issues. These are separate problems.

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.