Fix for (slow) memory leak in ClientState#1258
Merged
ignasi35 merged 2 commits intoakka:masterfrom Feb 8, 2021
Merged
Conversation
johanandren
approved these changes
Feb 5, 2021
Contributor
johanandren
left a comment
There was a problem hiding this comment.
Lookin good, left some nitpicking as a weekend gift.
johanandren
approved these changes
Feb 8, 2021
2362626 to
4439127
Compare
`ClientState` registered a `whenTerminated` callback to close the client when the actor system terminates. However, this `whenTerminated` callback is never removed, meaning it will hold on to the `ClientState`, causing a (small) memory leak each time a client is instantiated. akka#1257
Contributor
|
Hi @raboof, the branch for this PR starts on the commit tagged |
Contributor
Author
No, I just started there because that was the version we encountered the leak with. This way we could merge it into a 1.0.x branch, but I don't see a strong reason to have such a branch. |
Contributor
|
workflow issue is unrelated to this PR (See #1259 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClientStateregistered awhenTerminatedcallback to close the client whenthe actor system terminates. However, this
whenTerminatedcallback is neverremoved, meaning it will hold on to the
ClientState, causing a (small)memory leak each time a client is instantiated.
This PR is intended to fix the problem, but doesn't work due to what
looks like an extension initialization deadlock. That reminds of
akka/akka-core#28046 but it also seems present when I
switch to master, which is on Akka 2.6
Refs #1257