Sellorio / mega-macro

A World of Warcraft AddOn that replaces the built in macro functionality allowing more and bigger macros.
17 stars 13 forks source link

Extreme memory usage -> Garbage collection stutter #189

Open michaelvolz opened 1 year ago

michaelvolz commented 1 year ago

First, I want to thank you for this amazing add-on, I love it very much.

The memory usage on the other side is catastrophic. It takes 62-7x MB of the LUA memory. This is more than most of my other add-ons combined. The more memory used, the more often the garbage collection is triggered, especially when the memory is allocated in real-time while idle.

Is there maybe a way to allocate less memory? Possibly one sub add-on per class which will be dynamically loaded? Possibly reusing existing variables? Anything would be fantastic.

aurelion314 commented 1 year ago

I looked into this and found the base memory usage is around 64mb, which is a lot yes, but not actually that crazy. Details and other addons use even more for me when not just sitting in a city. More importantly, it isn't that high due to memory leakage. There is a memory leak yes, but its rather small, in the kilobytes range, not megabyes, so unlikely to cause problems.

What is more likely causing frame drops is the high CPU usage of Mega Macro when rendering macro Icons. Mega Macro uses considerably more CPU than most addons, since it has to update macro icons in real time.

If it's a real problem for anyone, you can try using my forked version of Mega Macro that includes an option to disable the icon updating of mega macro, reverting back to Blizzard default. This almost entirely removes the CPU overhead and also avoids the memory leak. Though it does have the drawback of reducing the character limit on macros to 250. You can find it here. (There is a PR for it, but it's a big change so it hasn't been merged to the main branch yet)