Hi guys...
I've a little little problem:
I use in my userinfo scripts some tables. Now:
Start hub-->memory=256K
Running-->memory=6000-8000 Kb
During run i don't need all of theese tables and i want to discard them...but HOW?? ?( ?( ?(
I've tried to re-initialize them (tablename={}) but memory is not released...
Please help me...
Thanks in advance!!
Bye!
pretty much a guess but have you tried to give it a nil input, works with some other laguages
tablename={nil}
well maybe this helps abit, duno for sure if it's what you looking for...
Code:
function Clear()
collectgarbage()
flush()
end
thats what i use for my function OnExit()
So How would a correct function look like then if I want
to emty the table...
I have same table in every userfile
so when loading one and then another one above first should be overwritten right???
Or is it a way to clear the data in memory when usercommand is used???
This was a nice thread... Got me open my eyes... hehe...
/NightLitch
i thaught table = {} is enough, and the garbage collector will do the rest by time ? or not?
but if C: & T: are getting high then this is a nice trick to refresh them without restarting script or loosing any data... If i'm explaining this correctly. Think it can be done in some more words
So there for i say it helps -->> A Bit <<---
But maybe there are some more tricks... really like to know them then?
hmmmmm well in that case
you cud add this function to the bot
function Clear()
anytableyuwannaclear = {}
andvaribaletoclear = nil
collectgarbage()
flush()
end
then ontimer or whereer add
function OnTimer()
Clear()
end
thats how my flush works
QuoteOriginally posted by c h i l l a
i thaught table = {} is enough, and the garbage collector will do the rest by time ? or not?
YESSS!!
I've used first only Clear()...and nothing...
then i've used table={} and Clear() and it's OK!!
THANKS TO ALL!!! :D