Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchWith memory leak #26625

Closed
longshorej opened this Issue Mar 27, 2019 · 0 comments

Comments

Projects
2 participants
@longshorej
Copy link
Contributor

commented Mar 27, 2019

I'm investigating a memory leak we're seeing with our services using Akka 2.5.21.

We're using the mqtt-streaming connector, which is written in Akka Typed, and uses context.watchWith to watch an actor and receive a custom domain message when it terminates.

This appears to be causing a memory leak, as the entry in DeathWatch's terminatedQueued is never removed. That set is only cleaned when a Terminated is received, which never happens when using watchWith.

I'll be submitting a PR shortly with a fix for this leak.

longshorej added a commit to longshorej/akka that referenced this issue Mar 27, 2019

Fix memory leak in watchWith (akka#26625)
Instead of delivering the custom message, store it locally and then
deliver it when the Terminated instance is received.

This ensures that terminatedQueued is properly cleaned when watchWith is
used.

longshorej added a commit to longshorej/akka that referenced this issue Mar 28, 2019

Fix memory leak in watchWith (akka#26625)
Instead of delivering the custom message, store it locally and then
deliver it when the Terminated instance is received.

This ensures that terminatedQueued is properly cleaned when watchWith is
used.

@patriknw patriknw added this to Reviewing in Akka Typed Mar 29, 2019

longshorej added a commit to longshorej/akka that referenced this issue Mar 29, 2019

Fix memory leak in watchWith (akka#26625)
Instead of delivering the custom message, store it locally and then
deliver it when the Terminated instance is received.

This ensures that terminatedQueued is properly cleaned when watchWith is
used.

@patriknw patriknw added this to the 2.5.22 milestone Mar 29, 2019

Akka Typed automation moved this from Reviewing to Done Mar 29, 2019

patriknw added a commit that referenced this issue Mar 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.