Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
Script that consume too much RAM? Scripts with memory leak.
In many cases it's better to leave small memory leak in LUA to reduce CPU usage.
Example:
Some temporary table with NPC state.
PHP:
local function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local player = Player(cid)
if isInArray({"soft", "boots", "repair", "soft boots"}, msg) then
npcHandler:say("Do you want to repair your worn soft boots for 10000 gold coins?", cid)
npcHandler.topic[cid] = 1
elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then
...
There is table 'npcHandler.topic' indexed by 'cid'. 'cid' changes every relog, so after player...
just do collectgarbage("count") / 1024 for MB
and yes, if your process is using ~4.4 gigs of memory it's your sources, not Lua
have you restarted your server and watched memory as time goes on?
generally if you have a memory leak over time you'll see it keep growing and growing
thanks bro!
I used valgrind and its generate one output but the TFS dont starts :
command: valgrind --leak-check=full -v --log-file=valgrind-out.txt ./tfs
Hey guys, the best way is the player:getGuid(), right?
because the other method player can say "bye" to npc and the function onDisappear dont will execute, I'm wrong?