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

Drop reference to cached items asap in to_xxx #509

Merged
merged 1 commit into from
May 26, 2020

Conversation

MainRo
Copy link
Collaborator

@MainRo MainRo commented Apr 25, 2020

This reduces memory consumption on cases where the cached items are
quite big and: The observable is not disposed immediately or the
completion callback triggers other computations.

This reduces memory consumption on cases where the cached items are
quite big and: The observable is not disposed immediately or the
completion callback triggers other computations.
@MainRo
Copy link
Collaborator Author

MainRo commented Apr 25, 2020

I have cases using to_list where the resulting list is quite big (several GB). The result is then processed in the completion callback. This change allows to free the list as soon as it is not used by the downstream computations instead of keeping it as long as the program runs.

Copy link
Collaborator

@jcafhe jcafhe left a comment

Choose a reason for hiding this comment

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

Good catch! You are right, that makes no sense to keep those references declared at operator scope.

@MainRo MainRo merged commit e0fa087 into ReactiveX:master May 26, 2020
@jcafhe jcafhe added this to the 3.1.1 milestone Jul 9, 2020
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