lua-users home
lua-l archive

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


Hi there,
 
    I have an application where i am loading large amounts of scripts as needed, currently this is though my own chunk loader which loads then off my rom flash fs. These little scripts perform simple rules for generating events. What i have noticed is that i load a chunk, it executes, then the chunk ends then there seems to be more memory used, i the same chunk again and then it uses up more memory, then usage is not consistent, but around 2K every time... the script is as below. What i am wanting to know is how after running the below script can i free any internal structures related to that script, or even just the trash the last chunk loaded, or all chunks in memory, i still want to preseve all the gobal variables and so forth so a lua_close is not possible. If anyone can offer some help that would be greatly appreciated.
 
if value == nil then
    value = 1
else
    value = value + 1
end
 
print( "this script has been executed ".. value .." times\r\n");
 
Many Thanks,
 
    Andrew Teirney