Skip to content

[1.x] Fixes memory leak - #359

Merged
taylorotwell merged 12 commits into
mainfrom
fix/memory-leak
Jan 5, 2026
Merged

taylorotwell merged 12 commits into
mainfrom
fix/memory-leak

Conversation

@joedixon

@joedixon joedixon commented Jan 2, 2026 •

Copy link
Copy Markdown
Collaborator

Builds upon #357 to resolve #331

There is already a listener for the message event registered so we don't need to register a new one for every request to get metrics. Instead, we can utilize the existing listener to know when Redis pubsub events are being fired and decide when to execute callbacks using our own login in Reverb, cleaning up events as they complete (or time out).

This also fixes and issue where multiple concurrent attempts to get metrics could get in each others way.

Big thanks to @boutetnico who laid the foundations for this fix.

@joedixon joedixon changed the title WIP Fix memory leak Jan 2, 2026
@joedixon joedixon changed the title Fix memory leak [1.x] Fix memory leak Jan 2, 2026
@joedixon joedixon changed the title [1.x] Fix memory leak [1.x] Fixes memory leak Jan 2, 2026

@boutetnico boutetnico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @joedixon, I have tested your PR locally, it works! No memory leaks observed. See 2 minor code suggestions below. Thanks!

Comment thread src/Protocols/Pusher/MetricsHandler.php Resolved
@joedixon
joedixon marked this pull request as ready for review January 5, 2026 09:08
@taylorotwell
taylorotwell merged commit f19950f into main Jan 5, 2026
@taylorotwell

Copy link
Copy Markdown
Member

Thanks folks! 🫡

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.

Memory leaks and high CPU usage

3 participants