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

ReplaySubject memory leak #578

Closed
roganov opened this issue Oct 22, 2015 · 6 comments
Closed

ReplaySubject memory leak #578

roganov opened this issue Oct 22, 2015 · 6 comments

Comments

@roganov
Copy link

roganov commented Oct 22, 2015

ReplaySubject would clear its cache of events only when a new observable subscribes, otherwise the array of events grows indefinitely.

Steps to reproduce:

var rs = new ReplaySubject(1);
while (true) {rs.next(1)};

Apparently introduced by this 488ac2e commit.

@trxcllnt
Copy link
Member

@roganov good catch, I knew there was a reason we need to trim on each next. @Blesh @staltz comments?

@staltz
Copy link
Member

staltz commented Oct 23, 2015

Yeah you can blame me for taking it out. Certainly looked fishy, perhaps a refactor could help clarify it's not just "getting" the events.

@benlesh
Copy link
Member

benlesh commented Nov 16, 2015

@staltz ... has this been fixed?

@staltz
Copy link
Member

staltz commented Nov 16, 2015

Not yet. I'll do it.

@benlesh
Copy link
Member

benlesh commented Nov 16, 2015

Okay, thanks @staltz ... I wasn't asking you to do it, I was just quickly checking to see if I missed that this needed to be closed.

staltz added a commit to staltz/RxJSNext that referenced this issue Nov 17, 2015
Add test for ReplaySubject that checks a memory leak should not happen when feeding in events to the
ReplaySubject synchronously, without any subscriber involved.

Related to issue ReactiveX#578.
staltz added a commit to staltz/RxJSNext that referenced this issue Nov 17, 2015
Fix ReplaySubject to attempt to trim its own buffer of events whenever a new event is fed through
next().

Resolves issue ReactiveX#578.
staltz added a commit to staltz/RxJSNext that referenced this issue Nov 26, 2015
Fix ReplaySubject to attempt to trim its own buffer of events whenever a new event is fed through
next().

Resolves issue ReactiveX#578.
kwonoj pushed a commit that referenced this issue Nov 30, 2015
Fix ReplaySubject to attempt to trim its own buffer of events whenever a new event is fed through
next().

Resolves issue #578.
@kwonoj
Copy link
Member

kwonoj commented Dec 1, 2015

Closing this issue by PR #742 now merged.

@kwonoj kwonoj closed this as completed Dec 1, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants