Memory Cleaner/Garbage Collector v1.0 
17 comments Memory Cleaner or Garbage Collector by
MikuAuahDark
Description 
This LUA would make your server more faster by cleaning memory every 5 minutes and every 5 times(default, can be configured at MemoryCleaner.lua)
This LUA is presents for a newbie scripter
This LUA is useful when you're running big scripts
It just use collectgarbage() LUA function
Features 
Improved AddHook 2 (5) compatible
Configurable settings(see below)
How to Install 
Just put MemoryCleaner.lua or MemoryCleaner_desc.lua at sys/lua/autorun
Reserved Global Variables 
MemoryCleaner
CleanTimes
TimeToClean
ShowMsg
NormHook
Information 
Hooks: 1(
second)
Lines: 30
Configuration 
On MemoryCleaner.lua or MemoryCleaner_desc.lua you can see a configuration variable. Here is the list of it
CleanTimes - Every 5 minutes do x times cleaning(default 5)
TimeToClean - Clean every x seconds(default 300, 5 minutes)
ShowMsg - Show message when cleaning is performed to stdout/console. true by default
NormHook - Always use normal hook(
addhook) even if
Improved AddHook 2 (5) is used(true by default, it can make it little faster)
Rules 
You can use it for your server
You can edit it
You can upload at another website, say
MikuAuahDark made it
You can't say this is yours
You can't upload on another website without put me on credits
Notes 
1. Tell me if there is a bugs
2. There is a file named MemoryCleaner_desc.lua. It just do same but file contents are different. it has description how the code works.
3. You can use MemoryCleaner.lua or MemoryCleaner_desc.lua. It just do same
4. Note that this is just simple scripts
Version History 
v1.0
Initial Release



This LUA would make your server more faster by cleaning memory every 5 minutes and every 5 times(default, can be configured at MemoryCleaner.lua)
This LUA is presents for a newbie scripter
This LUA is useful when you're running big scripts
It just use collectgarbage() LUA function

























On MemoryCleaner.lua or MemoryCleaner_desc.lua you can see a configuration variable. Here is the list of it

















1. Tell me if there is a bugs
2. There is a file named MemoryCleaner_desc.lua. It just do same but file contents are different. it has description how the code works.
3. You can use MemoryCleaner.lua or MemoryCleaner_desc.lua. It just do same
4. Note that this is just simple scripts





edited 1×, last 03.11.13 01:00:23 am

Comments
17 comments



Log in!
You need to log in to be able to write comments!Log in

WHA DIS TING MANE TO MUCH TEXTTT

Does this really make a diference ?

Does this really make a diference ?
About how much seconds of diference ? - In a super hero script + admin script v30 for example.
Ãnywas helpful.
About how much seconds of diference ? - In a super hero script + admin script v30 for example.
Ãnywas helpful.

This LUA would make your server more faster by cleaning memory every 5 minutes and every 5 times
Why do you think that you're more efficient than Lua itself?
Same story as in Java with system.gc() IMHO
You know, it's very easy, but at least you wrote proper description. All descriptions would look like yours.


Nice Script, But need more explanation about how this Script really works. What exactly does it Cleans?
and also do you want to see some explanation how it works? take a look at MemoryCleaner_desc.lua

Nice Script, But need more explanation about how this Script really works. What exactly does it Cleans?

This Script is Hard :v , I Think you must teach me to make it :v
Code:
1
collectgarbage("collect")
i already said that is a simple script

i am suspicious. Does collectgarbage("collect") only delete values which are not needed?
It's delete a value which does not have any variable.



