Skip to content

reduce memory growth - #753

Merged
lindsgil merged 1 commit into
mainfrom
memory-leak-improvements
Aug 21, 2026
Merged

lindsgil merged 1 commit into
mainfrom
memory-leak-improvements

Conversation

@ryley-o

@ryley-o ryley-o commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Artbot has persistent memory growth over time, and eventually crashes its process.

This update reduces memory growth in three ways:

OpenSea reconnect — A new Phoenix client is only created after disconnect() on the previous one. Stale onError handlers are ignored via a generation counter, so they cannot spawn extra sockets. reconnectAttempts resets only after a stream event actually arrives, not at construct time.

urql — The Hasura client is now dedupExchange + fetchExchange. In-flight identical queries still share one request; results are no longer stored forever. network-only behavior is the same.

Discord sweepers — Messages older than 30 minutes are swept hourly. Users other than the bot are swept hourly. Channel and emoji caches are left alone so # routing and the gmsquig reaction still work.

@ryley-o
ryley-o requested a review from a team as a code owner August 21, 2026 19:55
@ryley-o
ryley-o requested a review from yoshiwarab August 21, 2026 19:55
@lindsgil
lindsgil merged commit e750257 into main Aug 21, 2026
3 checks passed
@lindsgil
lindsgil deleted the memory-leak-improvements branch August 21, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants