WoWInterface - View Single Post - Memory Leak ?
Thread: Memory Leak ?
View Single Post
05-04-17, 12:55 AM   #6
A Pyroguard Emberseer
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,934
Just my two cents in on the topic. With Blizzard's recent obsession over rewriting APIs into returning tables, the inherent problem in doing so is it can easily turn into a memory hog. The two most expensive value types in Lua are functions and tables. In your function, you're requesting 3 different tables from such APIs. Even though you're only getting their length, Lua still allocated the memory to store them and they continue to wait for a garbage collection cycle to pick them up. It doesn't matter if you didn't store them in a variable, they existed for the moment they were used in an expression and therefore still take up space in memory until Lua gets rid of them later.
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 05-04-17 at 12:59 AM.
  Reply With Quote