lua-users home
lua-l archive

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


Hi,

My workload has been bloating with incremental GC but working very well
with generational. However, with generational some "old" objects never get
freed up if nearly all of the allocations are young or no allocations are
happening. I'm calling lua_gc(L, LUA_GCSTEP, n); every second to ensure
these "old" objects are removed in incremental mode even if the app is
idle.

I'm curious if there are any options or thoughts here. I can tune the
incremental mode to be more aggressive but it'd be nice to stick with
GCGEN and as a maintainer I know it's hard to get feedback so...

More detail:

- My app creates some coroutines and a few associated objects
- It then runs the coroutines from start to finish at a high rate.
- The runs are all very short and at the end of the coroutine call _all_
of the new memory is now garbage.

- If there is one small userdata alloc per run (~60 bytes) default
incremental gets behind, but generational works very well.
- Sometimes no objects are created in a run (very fast! yay!)
- Rarely the base objects are updated. I need the __gc() call to run on
the old base objects soon after they are replaced to free resources.
- Trying to avoid a stop-the-world GCCOLLECT once per second (that does
work in GCGEN mode, but app is latency sensitive)

>From skimming code it looks like these base objects are being moved off
the young list, and since the base object allocations are so infrequent
the generational GC will only touch them after many replacements of the
base objects. Like I would need a way to step through only old objects?

Thanks,
-Dormando