DennisRas / WeeklyKnowledge

Track your profession knowledge across your characters
https://www.curseforge.com/wow/addons/weeklyknowledge
5 stars 0 forks source link

Extreme memory usage and game freeze on zoning #13

Closed hollo6 closed 1 week ago

hollo6 commented 2 weeks ago

Hi,

This addon is amazing, however, when it is enabled, it uses A LOT of memory (it is top consumer, with more than 1.5x the usage of the second one which is a bag addon with a HUGE database) and makes the game freeze for ~10 seconds after zoning (taking any portal) every time. Would it be possible to address this issue please?

Thanks!

DennisRas commented 2 weeks ago

@hollo6 Hi there Thanks for reaching out. Could you share the memory profile/source/numbers that you're getting? Have you tried playing with other addons disabled and see if it's still an issue?

The addon shouldn't be doing anything when zoning

hollo6 commented 2 weeks ago

For some reason, I cannot reproduce the memory usage thing on purpose, just noticed it when trying to figure out the reason of the freezes but I'm not getting it all the time. It was using ~150MB while the #2 did 75MB. I'm getting the numbers from TitanPerformance.

Now I tried to disable all addons except this and it won't load, I'm getting the following LUA error: Message: Interface/AddOns/WeeklyKnowledge/Core.lua:4: Cannot find a library instance of "AceConfig-3.0". Time: Sat Aug 31 13:54:17 2024 Count: 1 Stack: Interface/AddOns/WeeklyKnowledge/Core.lua:4: Cannot find a library instance of "AceConfig-3.0". [string "@Interface/AddOns/BetterAddonList/libs/LibStub.lua"]:23: in function `GetLibrary' [string "@Interface/AddOns/WeeklyKnowledge/Core.lua"]:4: in main chunk

Locals: self =

{ minors =
{ } minor = 2 libs =
{ } } major = "AceConfig-3.0" silent = nil

hollo6 commented 2 weeks ago

And the freeze goes away if I disable only this addon.

DennisRas commented 2 weeks ago

Thank you for the follow-up. Are you running the latest version of the addon?

hollo6 commented 2 weeks ago

Of course, v1.0.2

hollo6 commented 2 weeks ago

Enabling Ace3 (as a separate addon) makes it load but the loading screen times are still extreme. (Forgot to mention this along with the freeze)

hollo6 commented 2 weeks ago

So, to summarize:

  1. Normal addon setup: extreme loading screen time + freeze after
  2. Only this addon enabled: won't load, LUA error
  3. This addon + Ace3 separately: freeze is a bit shorter but loading screen time is already extreme
DennisRas commented 2 weeks ago

Yeah there's a bug with missing AceConfig. I'll have that fixed in a moment. However there's no indication as to why you would have slow loading/high memory.

Edit: Currently investigating...

hollo6 commented 2 weeks ago

I just did a little more testing and it seems that the loading screen issue is baseline and the freeze is related to the database. I deleted the DB from WTF and the loading time issue is there but the freeze is shorter when there's no DB with all my characters in it.

DennisRas commented 2 weeks ago

I'm currently rewriting a couple of things. Would you mind testing the changes before I publish them online? It requires for you to manually replace the addon files from the main Code folder/tab here :-)

hollo6 commented 2 weeks ago

Sure! Happy to test and try anything, debugging is the thing I'm best at. :)

DennisRas commented 2 weeks ago

Alright give me 10 minute to make some updates. Appreciate you

DennisRas commented 2 weeks ago

@hollo6 If you click the green Code button in the Code tab and download the ZIP file and replace your addon files with those then you should have the latest unpublished version. Give it a try in those scenarios you had earlier (solo addon, with other addons etc.) and see if you notice a difference.

Do note that downloading the ZIP file itself you get more files in your addon folder, but you can replace it again with the official version after once I've pushed the next version to CurseForge etc.

Lastly, thank you for taking the time. You rock.

DennisRas commented 2 weeks ago

Hopefully it should feel a lot more instant/smooth :-)

hollo6 commented 2 weeks ago

Thanks a lot for the effort! I will try the new version and test a couple of use cases I can think of. Shall I get rid of the DB first?

DennisRas commented 2 weeks ago

Thanks a lot for the effort! I will try the new version and test a couple of use cases I can think of. Shall I get rid of the DB first?

No keep the DB. It has no effect to it all and is unchanged.

hollo6 commented 2 weeks ago

This seems to be all good! Thanks a lot for the quick fix, you're awesome! Now I accidentally enabled the addon on some lowbie alts while testing, is there an easier/quicker way to get rid of their data without manually editing the DB file? :)

DennisRas commented 2 weeks ago

That's awesome. I'll publish the addon in a minute. Mind if I give you credit for the help? Just adding "@hollo6" unless you prefer a different name.

For the lowbie, I'm adding the following setting #10 and will add a filter to not store data for lowbies/older expansion professions.

hollo6 commented 2 weeks ago

Sure, you can write Hollo or hollo6 whichever you like, thanks for the credit :) For the lowbies, I would actually prefer a toggleable list or something because some of my alts already have TWW profs for some misc stuff but I don't want to track them.

crusha015 commented 1 week ago

Not sure if the fix you tested with Hollo has been pushed live yet, but I am still seeing massive memory usage when I first load into the game on a new character. 400+ MB at times. And now after getting 4 character saved, it looks like it's holding steady around 200mb. That's more than TSM is using for me! Hoping that the fix discussed above has not been implemented yet.

crusha015 commented 1 week ago

Actually, an update is that the usage has dropped down significantly after about 5 minutes. Now it's at 362kb

crusha015 commented 1 week ago

Ok final update. I updated manually from the repo and it's way better now. The version on Curse was a few days old so it didn't have your performance tweaks. All good now!

DennisRas commented 1 week ago

Ok final update. I updated manually from the repo and it's way better now. The version on Curse was a few days old so it didn't have your performance tweaks. All good now!

Hey there :-) I'm pushing an update today together with some other things. I appreciate you taking the time to give some feedback and I'm glad it worked out for you as well.

DennisRas commented 1 week ago

This has been fixed in v1.0.3