Open Skelmis opened 1 year ago
Items get cleared from the cache correctly, but in lazy mode they appear to hang until next usage. Hopefully forcing all caches to be non lazy should resolve this uncapped growth to an extent
I did not mean to close it with that commit
That commit should resolve cache growth for those 2 object types, however, I believe the issue itself is still something else bigger. It should be better now, but still not perfect
These changes appear to have made it better, but will leave this open to continue tracking it and see what happens after a bit of continuous runtime
313 MB now, definitely grown
Implement this and see if it helps: https://discord.com/channels/808030843078836254/1196843077659283496/1196895914032373830
Changes occurring over the last couple months appear to have spurred some form of memory leak, with bot ram usage nearly doubling despite there being no apparent features to require this.
Current ideas appear to be pointing at
TimedCache
not releasing objects, with a preference towardsMemberStats
being cached for 15 minutes but not cleared from memory afterwards.Further investigation is required to properly debug this, however I am currently blocked by:
When attempting to interact with
gc
as printing empty streams failsData dumps with member stats enabled:
Further objgraph growth checks when calling
log_stats
result in this being the only changes:Given this is called on almost every action this is likely the primary cause for issues, however, we also generate lists and dicts in other locations which do not appear to be cleared. So simply removing
log_stats
will not fix the issueRefs:
TODO:
TimedCache
and see if it correctly clears items when evicted from cache