Thread Tools Display Modes
02-07-10, 03:40 PM   #1
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
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.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"
  Reply With Quote
02-07-10, 04:01 PM   #2
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
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.
  Reply With Quote
02-07-10, 07:05 PM   #3
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
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.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"

Last edited by acapela : 02-07-10 at 07:09 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Debugging Addon Memory Leaks?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off