lua-users home
lua-l archive

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


> I know that Lua does garbage collection of unused objects... but does it
> also compact the free memory or does the memory pool become fragmented?

Have you read "The Memory Fragmentation Problem: Solved?"

>From http://lua-users.org/lists/lua-l/2002-11/msg00288.html:

> Anyone concerned about fragmentation should read
> "The Memory Fragmentation Problem: Solved?"
> (http://www.cs.utexas.edu/users/wilson/papers/fragsolved.pdf), and
> eventually change his malloc library.
>
> This paper substantially strengthens the original fragmentation
> results presented in our earlier allocator survey, showing that
> for a variety of applications, good allocators exhibit nearly zero
> fragmentation---about one percent on average, for 8 varied C and
> C++ programs. While it is clear that there must exist some programs
> for which this is not true, it shows that the received view of
> the fragmentation problem is simply wrong, and fragmentation is
> not the kind of problem 30 years of research generally assumed it
> was---typical program behavior is very favorable to several clearly
> excellent allocation policies, due to strong regularities in program
> allocation and deallocation behavior.

-- Roberto