lua-users home
lua-l archive

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


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.

I have about 130 000 userdata objects. The reason for that insane ammout is that I am simulating a big world and many of the C/C++ objects are mirrored on the Lua side as userdata.

My plan now is to reduce the number of "mirrored" objects by rewriting the structures so that Lua doesn't keep a live reference to everything on the C side, but instead just fetches the references it needs to work on from C and then releases them.

Since this might be a significant rewrite I just thought I should ask first if anyone else has encountered this problem or has any other ideas on how to address it.

// Niklas