Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak #20

Open
zaphon opened this issue Jan 23, 2024 · 7 comments
Open

Memory Leak #20

zaphon opened this issue Jan 23, 2024 · 7 comments
Assignees
Labels
Blizzard issue caused by an issue on Blizzard's side bug

Comments

@zaphon
Copy link

zaphon commented Jan 23, 2024

I have been troubleshooting another issue when I noticed that Decursive about every 20-30 seconds grows to about 200+ MB of memory usage before Garbage Collection kicks in and it drops back down off the list. And than I watch it grow back up to 200+ MB again over and over. Obviously GC takes care of the leaked memory, but it's not free, and might be something worth looking at. I've honestly never noticed it before, but I also don't watch my addon memory usage that often either. So not sure how long it's been doing this.

@2072
Copy link
Owner

2072 commented Jan 23, 2024

Thanks for reporting this, can you give me more details on the conditions for this memory leak to occur, is it constant or only in certain conditions? I suppose you are using the latest version?
What version of WoW are you using? (classic, wrath or retail)

Can you try with Decursive alone? or reinstall Decursive with libraries installed separately? (you will need to use the -nolib files provided here https://github.com/2072/Decursive/releases and install the libraries separately in the Curse Client - right click on Decursive -> install settings -> install libraries separately) because this can be caused by another add-on using one of Decursive's shared libraries...

Note that I could not reproduce this issue.

@2072 2072 added the Waiting_For_Information When there is not enough information to work on the issue. label Jan 23, 2024
@2072 2072 self-assigned this Jan 23, 2024
@zaphon
Copy link
Author

zaphon commented Jan 23, 2024

Oops, yeah I can provide the details.

This was on retail, I was in a 40 man raid (doing the Superbloom event), and I am on the latest version. I will attempt to isolate this issue further as suggested (no other addons, and using the -nolib version). I will report back my findings after I do so. I will have to wait until the day time (US) as right now none of the events will get anywhere near a 40 man group.

@2072
Copy link
Owner

2072 commented Jan 23, 2024

I think I found the problem, unfortunately it's on Blizzard's side. It has to do with their new C_UnitAuras APIs which are creating garbage internally every time they return a buff and debuff data....
The new API should allow me to limit the number of calls and useless data return (which should limit the leaking only when a unit has active buff/debuff of interest) but it's a Blizzard issue they have to fix on their side...

For now what you can do to limit the damage when there is no buff/debuff on units is to disable the "Show Stealth Status" in the Micro Unit Frame option panel. This will stop Decursive scanning for stealth buffs.

@zaphon
Copy link
Author

zaphon commented Jan 23, 2024

Fun, gotta love these patches / improvements. :-)

I did actually manage to get to test it with no other addons than Decursive (I see the same issue, but it goes from like 8MB to 30MB before it get's GC'd), same with no other addons with the nolibs version (similar to above, still see the climb, but get's GC'd even earlier), and finally with all my AddOns and nolibs version of Decursive (I already have every single lib dependency via other AddOns), and it was similar to the original. I'll look at the option above, but I honestly don't think GC is the issue I'm running into. I have another addon doing something it's not supposed to, just haven't narrowed it down yet (when I found the issue I reported, I disabled decursive all together to try and isolate the issue, there was no difference in behavior)

@2072
Copy link
Owner

2072 commented Jan 23, 2024

The memory garbage leak you see is definitely caused by C_UnitAuras.GetDebuffData* functions. These return a new Lua table each time and this is this table that is creating the garbage data you see. Decursive will call these functions once every second for each debuff on each unit, and each buff (if you have the stealth detection option enabled)... So the more units Decursive manages and the more these units have buffs/debuffs the more garbage data will be generated...
I'm not sure why Decursive needs to scan all the units every second (I don't remember why I can't just rely on aura events) but I remember there was a use case... (there is even internal debug in Decursive to detect when the every second scan sees something that was not reported by an aura event)

@2072 2072 added bug Blizzard issue caused by an issue on Blizzard's side and removed Waiting_For_Information When there is not enough information to work on the issue. labels Jan 23, 2024
@2072
Copy link
Owner

2072 commented Jan 24, 2024

I've released a new alpha version to fix the most serious memory leak:

https://www.wowace.com/projects/decursive/files

can you test it and tell me the result?

@zaphon
Copy link
Author

zaphon commented Jan 25, 2024

Thanks for this, I'm traveling for work but will be back tomorrow and will test it ASAP.

2072 added a commit that referenced this issue Jan 26, 2024
…ns to control the global periodic debuff rescan

We need to test if we can go without this periodic rescan, you can set the setting to 0 in order to disable it completely or increase the delay between scans to a high value (10s) and enable the "Periodic scan debug reporting" options. This will create a debug report that would pop out after a fight if the scan function detected something that was not detected by the event system.
NOTE: Currently changing the curing options (directly or indirectly through ability changes may trigger this report - next alpha versions will prevent this)
2072 added a commit that referenced this issue Feb 19, 2024
…eport header.

This will help to track if the periodic rescan is still useful or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blizzard issue caused by an issue on Blizzard's side bug
Projects
None yet
Development

No branches or pull requests

2 participants