Break reference cycle in StreamContainer.get()#2221
Merged
WyattBlue merged 1 commit intoPyAV-Org:mainfrom Apr 2, 2026
Merged
Conversation
StreamContainer.get()StreamContainer.get()
|
@lgeiger Don't have the bandwidth to test this right now; In the meantime, wouldn't it be better to add the code to the tests and run it through CI? |
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.
StreamContainer.get()defines aprocessfunction which bindsself. This causes a reference cycle putting strain on the Garbage collector. This can be reproduced with the following code:We could also break this reference cycle by setting
process = Noneafter it's use inStreamContainer.get()but I think moving it into a separate method which yields is cleaner.@oakaigh can you check whether this fixes #2219 for you?