lua-users home
lua-l archive

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


out of curiosity, how much memory are you using for all these objects?
(lua + the c++ side allocations)
how much of the world could you fit in, say, 256k?

On Dec 3, 2007 10:34 AM, Niklas Frykholm <niklas@grin.se> 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.
>
> 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
>