[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Garbage collection and Lua 4.1 Alpha
- From: "Josh Jensen" <joshj@...>
- Date: Fri, 3 Aug 2001 16:07:29 -0700
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
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.
Amped: Freestyle Snowboarding