[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: g->GCthreshold overflow, possible bug?
 
- From: Roberto Ierusalimschy <roberto@...>
 
- Date: Mon, 13 Aug 2012 11:17:09 -0300
 
> Today I noticed some strange behavior in my lua application:
> My application disables lua autogc and manually calls
> lua_gc(LUA_GCSTEP) regularly. When memory usage exceeds 2G, each
> call to lua_gc(LUA_GCSTEP) becomes a full gc cycle (retval = 1).
> I managed to track down the cause of this problem to the following
> line in lgc.c:
> 
> #define setthreshold(g)  (g->GCthreshold = (g->estimate/100) * g->gcpause)
> 
> When g->estimate exceeds 2G and gcpause remains its default value
> 200, GCthreshold will overflow uint32 range.
> [...]
> 
> Is this a bug?
Yes.
> Is there any known solution for this?
Did you try to change the pause to 100, to avoid the overflow?
-- Roberto