lua-users home
lua-l archive

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


Rici Lake wrote:

On 3-Dec-07, at 8:34 AM, Niklas Frykholm wrote:

I am seeing a GC stall of about 8 ms in luaC_separateudata(). After looking at the code and reading chapter 31 of Programming in Lua, I think that there simply are too many userdata objects in my lua state.

That's probably not the issue. luaC_separateudata() atomically loops over all the userdata objects which are available for garbage collection. So the pause time reflects the number
of objects being collected, not the number of objects available.

Since you have a lot of objects in your lua univese, the incremental garbage collector isn't running often enough, and when it does run you have a large number of userdata's to collect. (I'm referring to the total number of objects, not just the userdatas.)

Are you sure about that? I've added an iteration counter to luaC_separateudata(). Running it with different values for setstepmul shows:

setstepmul   iterations   deadmem

200          114717       2283852
400           74415       1885904
800           51966        446576
1600          39158        307140
3200          32471        191100
6400          29014         87480
12800         27247         42704

While deadmem seems to fall off "sort of linearly", iterations seems to level out at about 26000 iterations or so. I guess that is the "base set" of objects, and the other objects we are seeing are the temporary objects.

// Niklas