Earlier Versions
Name | Size | Uploaded | Game Version | Downloads | |
2022-10-30-release-wrath release | 5.58 KB | Oct 30, 2022 | 3.4.0 | 159 | Download |
2022-10-30-release-bcc release | 5.58 KB | Oct 30, 2022 | 2.5.4 | 5 | Download |
2022-10-30-release-classic release | 5.58 KB | Oct 30, 2022 | 1.14.3 | 14 | Download |
2022-10-30-release release | 5.58 KB | Oct 30, 2022 | 10.0.2 +3 | 884 | Download |
2021-07-04-release-bcc release | 4.99 KB | Jul 4, 2021 | 2.5.1 | 226 | Download |
2021-07-04-release-classic release | 4.99 KB | Jul 4, 2021 | 1.13.7 | 80 | Download |
2021-07-04-release release | 4.99 KB | Jul 4, 2021 | 9.1.0 | 703 | Download |
2018-08-13-release release | 3.83 KB | Aug 13, 2018 | 8.0.1 | 1,547 | Download |
2018-08-01-release release | 3.72 KB | Aug 1, 2018 | 8.0.1 | 678 | Download |
2017-09-03-release release | 3.72 KB | Sep 4, 2017 | 7.3.0 | 1,208 | Download |
2017-07-22-release release | 3.73 KB | Jul 22, 2017 | 7.2.5 | 684 | Download |
2016-10-27-release release | 3.83 KB | Oct 27, 2016 | 7.1.0 | 1,314 | Download |
2016-09-15-release-3 release | 3.84 KB | Sep 15, 2016 | 7.0.3 | 730 | Download |
2016-09-15-release-2 release | 3.82 KB | Sep 15, 2016 | 7.0.3 | 192 | Download |
2016-09-15-release release | 3.88 KB | Sep 15, 2016 | 7.0.3 | 242 | Download |
2016-09-09-release release | 1.50 KB | Sep 9, 2016 | 7.0.3 | 405 | Download |
Description
Some WoW addons call the lua collectgarbage function irresponsibly, causing all execution to halt until it is finished. This can take more than half a second, which freezes the game in an annoying manner. Most addons don’t need to make such calls, but some do anyway, causing these lockups.
Instead of maintaining the removal of collectgarbage calls in all the addons I use, I decided to write this tiny addon which intercepts these irresponsible collectgarbage calls to prevent these chunky lockups and freezes. Now my game feels smoother when performing various actions which previously caused stutters from collectgarbage.
I’ve also added a hook for UpdateAddOnMemoryUsage, a CPU-intensive function which I found several addons were calling when they weren’t even profiling for any reason. With this addition, I figured some people may want the option to disable this hook so they can do memory profiling with GarbageProtector on, so I made CLI and GUI options menus. Plus, if you’re an addon author, you can run ToggleGarbageProtector, ToggleHandlecollectgarbage, or ToggleHandleUpdateAddOnMemoryUsage directly to disable the interference of either of GarbageProtector’s hooks.
The addon’s folder name has 3 “!”s at the beginning to cause it to be loaded first, before any addons that would slow loading screens with collectgarbage calls. There is another addon with 2 “!”s that I wanted GarbageProtector to load before, so that’s why 3 instead of 2 or 1.
Warning: Due to the nature of the 2 hooks GarbageProtector implements, unless the hooks are toggled off (from either the GarbageProtector options menu, the command line interface, or the Lua setter functions), it will prevent:
- full manual garbage collection cycles (function named “collectgarbage”; does not prevent the regular rate of Lua’s garbage collector)
- updating the current count of addon memory usage (function named “UpdateAddOnMemoryUsage”; makes profiling addons show 0 or their most recently-queried value)
For example, ElvUI has a feature to run a garbage collection manually by clicking somewhere. This is prevented by GarbageProtector because it is an irresponsible use of collectgarbage which locks up your game (which if run automatically like some addons do, is not nice to the user). However, if you really want to run it, you can toggle GarbageProtector’s option with “/gp collectgarbage” or from the GUI options menu. That’s why I added options in the first place: so you can choose what you want to do.
Add a comment