Lua's memory management
Lua allows you the facility to add your own memory allocation management by calling [lua_setallocf]. You may want to replace the standard allocation routines in order to keep Lua's allocation separate or introduce an allocator which may cause less fragmentation.
Here are some memory allocation libraries.
- dmalloc "The debug memory allocation or dmalloc library has been designed as a drop in replacement for the system's malloc, realloc, calloc, free and other memory management routines while providing powerful debugging facilities configurable at runtime. These facilities include such things as memory-leak tracking, fence-post write detection, file/line number reporting, and general logging of statistics." 
- dlmalloc Public domain code which is quite popular and apparently 40% faster than the default win32 allocators. 
- Hoard  "Hoard is a fast, scalable and memory-efficient allocator for multiprocessors. Hoard solves the heap contention problem caused when multiple threads call dynamic memory allocation functions like malloc() and free() (or new and delete). Hoard can dramatically improve the performance of multithreaded programs running on multiprocessors."
See also: GarbageCollection, GarbageCollectingWeakTables
RecentChanges · preferences
edit · history
Last edited July 4, 2008 8:44 pm GMT (diff)