WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Debugging Addon Memory Leaks? (https://www.wowinterface.com/forums/showthread.php?t=30520)

acapela 02-07-10 03:40 PM

Debugging Addon Memory Leaks?
 
dug into Aloft, using OptionHouse, at the behest of a user, and did indeed discover a slow memory leak (about 187Kb/hour).

Aloft makes rigorous/extensive use of recycling, always checks to see if things are already allocated before allocating them, and etc. as far as i know, there are no tools for tracking memory management in LUA (as embedded in the WoW client).

can anyone sanity check whether 187Kb/hour is "normal"? does anyone have any suggestions, obvious things to look for in the use of the Blizzard API, links to resources (discussion threads/etc), or anything else of the kind?

thanks.

Shadowed 02-07-10 04:01 PM

I haven't looked at Aloft lately, but you're memory usage is going to gradually go up regardless of what you do depending on how you recycle tables, you're going to be storing more data on mobs etc. If you're not using disembedded libraries, it could always be Ace2 that is contributing to it as well. You could always try luac -l <file> and look for (or grep) SETGLOBAL to see if you are leaking any globals.

Is it about 187 KB/hour or is it 300 KB one hour, 100 KB the next etc? If it's consistently in the range of 187, look at anything you do on a timer. It's possible you're creating a table or function on a timer.

OptionHouse isn't very good for actual profiling, you could also try Addon Profiler and see if you are creating 187 KB of static memory or 187 KB of garbage which would narrow it down a bit more.

acapela 02-07-10 07:05 PM

i only benchmarked for an hour. but Aloft does a lot of asynchronous processing as nameplates become visible, so in effect its on a variable timer. i will test some more, as you suggest, and look for variation over time.

there is a small (tiny/neglibible, a few kB per hour) amount of leakage when nameplates are disabled. it is always possible Aloft is not responsible for that (i.e. Ace2 or another embed). i will disembed and see if that changes.

as for the rest, thanks much, Shadowed. i will do all of the above.


All times are GMT -6. The time now is 01:53 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI