In my addon I noticed an unusual use of memory ranges from 200 kb to 1.10 mb. After several tests, I found the cause of this oscillation, located inside a function. I noticed that disabling (commenting) the other lines and leaving only this, the oscillation is still present. This function is called every OnUptate, and setting a refresh rate relatively high (about 50 sec) memory usage becomes stable.
I do not write the whole code because the source problem is only here
Lua Code:
function buffscan()
-- lines disabled
local meow = { "a","b","c","d","e","f","g","h" }
-- lines disabled
end
local timer = 0
local function onUpdate(self,elapsed)
timer = timer + elapsed
while (timer >= 0.75) do
if (not db.profile["Locked"]) then
for x, key in ipairs(db.profile["Bars"]) do
for y = 1, db.profile.Bars[x].columns * db.profile.Bars[x].rows do
buffscan()
end
end
end
timer = timer - elapsed
end
end
local f = CreateFrame("frame")
f:SetScript("OnUpdate", onUpdate)