lua-users home
lua-l archive

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


On Thu, Feb 27, 2014 at 7:38 PM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> in game (and game-like) coding.  the first things are obvious: "don't
> allocate needlessly" and usually "collectgarbage after each frame",
> but i'm sure there are lots more, maybe some tricks on designing
> GC-friendly structures... that could be translatable to other spaces

If my life was more flexible, I would really like to present the work
we've done with AndroLua, since there you have two garbage collectors
interacting with each other (Dalvik and Lua). The Android platform is
really sensitive to GC problems, so I had to shave down the garbage
overhead with LuaJava down to the bare minimum.

But the "interesting" problem (and it exists wherever you have this
coexistence of runtimes) is how to provide hints to the Lua GC that it
is holding large external resources.  And I don't think there's any
magic solution here, just being aware.  (One of the problems with GC
is that it has encouraged a whole generation of programmers to believe
that (a) memory is a solved problem and (b) memory is the only
resource worth worrying about)