Hi,
I have a problem. My script is taking to much memory, and I think it is because I don't use Flush() and CollectGarbage(). So here is also my question: What does it really do, and when is it useful?
My script is taking 300 Mb memory after 3 days running (not g00d).
Some help would be appriciated (links to info sites also).
Flush writes stuff it got in memory to files. Should use this often.
CollectGarabage free's all the memory which isn't needed anymore. This should also be used quite often. :)
QuoteOriginally posted by Pothead
Flush writes stuff it got in memory to files. Should use this often.
CollectGarabage free's all the memory which isn't needed anymore. This should also be used quite often. :)
"Flush writes stuff it got in memory to files." I don't get this. So flush writes data in files? Maybe someone can give an example, I don't get it very well...
The CollectGarbage() should I use after deleting data from the temp tables? And can it erase data what is still needed?
function Clear()
collectgarbage();io.flush();
end
i call this every 5 mins ... Maby a bit of an over kill But works :P :P
Hi, I will try that. I hope it will work with my huge script... Thanx :D
QuoteOriginally posted by TTB
"Flush writes stuff it got in memory to files." I don't get this. So flush writes data in files? Maybe someone can give an example, I don't get it very well...
It saves some information in memory which will be written to files when the script stops / ptokaX closes. Flush forces it to dump this information into the files, and outta the memory.