lua-users home
lua-l archive

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

I guess you can always use some sort of indirect measure. For example, you can
sample the average time elapsed with memory allocations, to see if it's growing too
much. Or compare the size of the heap (last address allocated - first address
alloc. ?) with the size of allocated structures. If ratio above a certain amount, the
memory should be fragmented (or not?).

The goal would be just to the programmer to know, with some margin for error,
that it's time to force GC+compact. Then it can tell the user: ok, move away
from the line of fire and stand in a dark corner while the world cleans itself
up... :-)


On 17 Oct 2002, at 11:32, Luiz Henrique de Figueiredo wrote:

> >Another idea: have a couple of functions on the Lua API for the
> >programmer to know an estimate of how bad fragmentation is
> How can we do that using ANSI C functions?
> --lhf
Fábio R. Cecin