As the title says... Chat on...

User avatar
By MK1888
#10576 I have only one script loaded. The size is 4299 bytes. When I dofile() it gives me a "not enough memory" error.

Really?!
User avatar
By B0SC0
#10645 I have seen this also.
I just hit the soft restart button if you are using lualoader.
Then everything is okay.
User avatar
By sevic71
#10677
The size is 4299 bytes.

I suppose, everybody who tried to develop some 'little' code for ESP met this issue sooner or later. Most probably, you really exceeded heap memory size with only such a little script. Note, that Lua is interpreter, so, size above is taken from heap only for script, then it adds "interpreted" portion, which may be much bigger than source itself and it is most not obvious thing, because your code may invoke some functions like server,connection etc. as well as internal variables. The only way is to split script in parts and execute them one by one depending from the logic you are trying to implement. You may (and in most of cases should) combine procedural and event-driven ways of code invocation. Like frequently used tasks should be wrapped to functions and called when needed, seldom used tasks may be executed by dofile() etc. Note, that ESP utilizes even-driven model, when you are not expected to monitor some events in main cycle, but implement some functions and assign them on event sources like interrupts, connection states, timers etc. Actually, main stream of your code should do only that and nothing more :)