lua-users home
lua-l archive

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


Yep, here we go again.

The garbage collection update for my title is over 60 milliseconds.
Since the frame rate is high, 60 milliseconds causes a very large,
unacceptable blip in the frame rate.

I am quite careful with any Lua functionality that causes memory to be
allocated.  I even go so far as to breakpoint the allocation function to
know for sure.  Unfortunately, I can't get rid of every allocation by
Lua while the game is running, and so the amount of memory used by the
script skyrockets.  It eventually hits a peak and runs the garbage
collection, but at that point, the collection takes FAR, FAR longer than
60 milliseconds.

So, my question is this.  Since Lua doesn't have an incremental garbage
collector, would it be possible to patch Lua to free the memory for nil
objects as they become nil?  This would be an acceptable alternative to
me.  It's been too long since I dug deep into the Lua internals to know
if this is possible.

Any other ideas would be great, too.

Thanks,
Joshua Jensen
Amped: Freestyle Snowboarding
http://www.xbox.com/Games/sports/amped.htm