[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Preventing memory leaks
- From: Edgar Toernig <froese@...>
- Date: Wed, 24 Oct 2001 16:36:39 +0200
Byron Guernsey wrote:
> I've noticed the memory footprint of the game engine grows with time
> and the games that execute Lua scripts frequently, grow much more
> quickly in size. The rest of the code has been checked extensively
> with BoundsChecker and has no notable memory leaks.
Iirc there was something to consider when compiling a lot of small
temporary chunks: the compiler assumes that the code will be kept
some time and increases the GC limit by the amount of memory used
by the new code (see ldo.c:protectedparser). This may result in
no GC runs if the chunks do nothing exciting memory wise.
Calling collectgarbage(0) sometimes should clean things up.