[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Garbage collection slowdown
- From: "Russell Y. Webb" <rw20@<a href="/cgi-bin/echo.cgi?cornell.edu">...</a>>
- Date: Tue, 05 Feb 2002 09:13:25 -0800
Have you looked to see if the number of Lua owned blocks is going up during
execution? In debug mode lua keeps a count and mem size (see lmem.h):
extern unsigned long memdebug_numblocks;
extern unsigned long memdebug_total;
extern unsigned long memdebug_maxmem;
extern unsigned long memdebug_memlimit;
Probably there are references accumulating that lua doesn't think it can
release and it just has to traverse them all. Why they are accumulating is
the real question but my crystal ball is not working right now. ;->
> From: "Martin Stone" <Martin.Stone@creations-group.com>
> Reply-To: email@example.com
> Date: Tue, 5 Feb 2002 16:53:54 -0000
> To: Multiple recipients of list <firstname.lastname@example.org>
> Subject: Garbage collection slowdown
> Hello everyone. I wonder if anyone can help me...
> I'm repeatedly forcing garbage collection every frame (in a game) like this:
> lua_setgcthreshold(L, 0);
> The time taken for this function to complete seems to increase with each call.
> In between calls the same lua function is called every frame, generating
> (presumably) a fixed amount of garbage each time.
> Does anyone know what I can do about this?