lua-users home
lua-l archive

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

I found good results from examining the GCState member of the
lua_State - every time it changed away from GCSfinalize I recorded the
current GC count; garbage collection was assumed to be done when the
difference between GC count was small. That only works for us because
we have a long time between large allocations (so the GC count rarely
goes up while collecting).

I didn't investigate too deeply into how many iterations it took
before GC completed for any given situation, I was more interested in
time taken to collect given various configurations of GC parameters.

On Fri, 18 Mar 2005 17:58:50 -0800, Mark Hamburg <> wrote:
> Is there a way to tell whether a call to step the garbage collector finished
> the collection? I want to run an idle time task to drive the GC forward but
> I want to stop the task once collection has finished.
> Mark