Debug addon

Hello,
I have, what appears to be, memory leaks in my addon. The memory usage keeps increasing.
Is there another addon or other product that might find it, or point to bad syntax ?

Thank you,
Mike

Likely it’s just building up to a threshold for automated garbage collection. I see similar things mine, but it resolves itself.

1 Like

Tables and strings that get discarded will accumulate and get cleaned up by the low-impact garbage collection over time. It’s natural to see memory usage creep up. It should drop back down over time on its own.

If you do a

/run collectgarbage()
you can force a garbage collection.

It’s also natural for an addon’s memory usage to climb up a bit and stay there after a garbage collection. It may be waiting until you use it to build its UI or populate tables.

If it seems out of hand, I would’ve not too long ago recommended the author look at places to reuse tables (wipe rather than recreate) or try not to spread out string concatenations to create unnecessary garbage. But I have been recently using using Blizzard’s ScrollBox controls which are amazing and they produce an omg insane amount of garbage; so my opinion of garbage is a lot more tolerant now.

But if you did want to monitor that stuff, an addon called Addon Usage will let you watch the memory usage of addons to see which one is accumulating the most. Just keep in mind it’s natural if their memory usage creeps up unless it’s going from like 15k to 30mb (unless it uses a ScrollBox in which case that’s normal, it’s hilarious).

2 Likes