Re: 0.91 luabind::call_function - leak

Harakiri <[email protected]> Wed, 11 Jul 2012 11:52:17 -0700 (PDT)
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
--- On Wed, 7/11/12, Willi Schinmeyer <[email protected]> wrote:

> From: Willi Schinmeyer <[email protected]>
> Subject: Re: [luabind] 0.91 luabind::call_function - leak
> To: [email protected]
> Date: Wednesday, July 11, 2012, 11:22 AM
>  > However, if call
> lua_gc(luaState, LUA_GCSTEP, 1); after every invoke, 
> the usage does not increasse ( but at the end, 4KB remain no
> matter how 
> many loop iterations i have - i gather this is the metatable
> for the 
> object class that remains?!).
> 
> Does starting garbage collection once after the whole
> iteration remove 
> the excess memory, too? In that case the garbage collection
> was just not 
> being invoked since Lua didn't mind the couple of MBs enough
> yet to 
> bother collecting them.

No - thats the issue - everything remains - only gc step will help after each invocation - a full GC after all invocations will not clear the memory.

> Because a metatable with class-related information gets
> stored in the 
> registry. That's normal. There's no way to unregister
> something.
> 

Yes - normal - but it would only be normal that for each class 1 metatable exist - however it looks like for each object of class A a new metatable is created. This makes no sense.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/