lua-users home
lua-l archive

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


In case the provided buffer consists of precompiled bytecode that just
declares functions, the globals are created, but is the function body
duplicated in memory, or is it used in-place ? In other words, if I provide
that same bytecode to several lua states, will I end up with as many
identical function bodies in memory ?

> -----Original Message-----
> From: Luiz Henrique de Figueiredo [mailto:lhf@tecgraf.puc-rio.br]
> Sent: mardi 23 juillet 2002 12:36
> To: Multiple recipients of list
> Subject: Re: memory leak when call do_buffer
> 
> 
> >I find that the memory usage of my application is increased 
> each time I call
> >do_buffer( ) to get a caculate result.
> 
> It's not a memory leak. It's just that the strings used 
> passed to do_buffer are
> still stored in Lua.
> 
> >Is there any way to free the memory used by do_buffer( ) 
> after calling it?
> 
> Yes, force a garbage collection with lua_setgcthreshold(L,0).
> --lhf
>