Smart Garbage Collector — Retirement Notice
After some reflection, I've decided to retire Smart Garbage Collector. The addon has served its purpose well, but with GarbageProtector now back under active development after an extended absence, there's no longer a need for a separate solution.
Going forward, I recommend switching to GarbageProtector as your replacement. It covers the same protection functionality and is now being actively maintained by its original author.
Smart Garbage Collector will be archived shortly. I won't be reviving or updating this project, so please make the switch at your convenience to ensure you continue receiving updates and patch compatibility going forward.
Thanks to everyone who used and supported the addon. It was a fun project while it lasted.
— Lollzer
Smart Garbage Collector


Lightweight memory management and GC protection for World of Warcraft
World of Warcraft uses Lua’s incremental garbage collector, which generally performs well. However, in add-on–heavy environments, poorly timed garbage collection or excessive memory queries from other add-ons can still cause noticeable stutters or frame drops.
Smart Garbage Collector helps smooth out those situations by managing when and how garbage collection occurs — without replacing or breaking WoW’s built-in behavior.
What This Add-on Does
✔ Controlled Incremental Garbage Collection
Instead of forcing full garbage collection cycles, Smart Garbage Collector:
-
Uses Lua’s incremental collectgarbage("step")
-
Runs small cleanup steps over time
-
Avoids stutters caused by large GC bursts
-
Adjusts aggressiveness automatically when needed
✔ Protection Against Wasteful GC Calls
Some add-ons trigger garbage collection or memory scans excessively. This add-on can:
-
Block external calls to collectgarbage()
-
Optionally block UpdateAddOnMemoryUsage()
-
Prevent repeated or unnecessary GC activity
-
Log which add-ons attempt these operations
This helps keep memory management predictable and avoids performance spikes caused by other add-ons.
Smart Safety Features
-
Skips cleanup during combat or loading screens
-
FPS-aware (avoids running when performance is already low)
-
Instance-aware (dungeons, raids, PvP, scenarios)
-
Prevents overlapping GC runs
-
Auto-adjusts behavior based on effectiveness
All GC activity is incremental and non-blocking.
Inspired by GarbageProtector
This add-on incorporates ideas originally introduced by GarbageProtector, which focused on blocking unsafe garbage collection calls.
Smart Garbage Collector builds on that idea by:
-
Adding controlled, step-based GC
-
Providing adaptive cleanup logic
-
Offering detailed reporting and configuration
Who This Is For
✔ Players with large add-on setups
✔ Users experiencing GC-related stutters
✔ Developers debugging memory behavior
✔ Anyone who wants smoother performance without manual cleanup
About CPU usage reports
Certain addon profilers (including older or continuously updating ones) measure cumulative execution time and can misattribute CPU usage, especially when many addons are installed.
Smart Garbage Collector performs small, periodic tasks which can accumulate in these reports without causing measurable performance impact.
Profilers that show per-frame timing or spike detection (e.g. Numy’s Addon Profiler) provide a more accurate picture of actual performance.
Slash Commands
/sgc – Open settings
/sgc run – Run cleanup manually
/sgc status – Show memory status
/sgc enable – Enable automatic cleanup
/sgc disable – Disable automatic cleanup
Technical Summary
-
Uses Lua incremental GC (collectgarbage("step"))
-
Never forces full garbage collection
-
Blocks external GC and memory scan spam (optional)
-
Safe, lightweight, and configurable
-
Designed to cooperate with WoW’s native GC system