GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix memory leak in bounded ReplaySubject due to retaining the node index by akarnokd · Pull Request #1866 · ReactiveX/RxJava

Conversation

@akarnokd

@akarnokd akarnokd commented Nov 12, 2014

Copy link
Copy Markdown
Member

indefinitely once the Subscriber caught up.

For issue #1865.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akarnokd
Fix memory leak in bounded ReplaySubject due to retaining the node index
24dcc2a
indefinitely once the Subscriber caught up.
@benjchristensen

benjchristensen commented Nov 12, 2014

Copy link
Copy Markdown
Member

This test failed both times:

rx.internal.operators.OperatorMergeDelayErrorTest > testErrorInParentObservableDelayed FAILED
    org.mockito.exceptions.verification.TooLittleActualInvocations: 
    stringObserver.onNext("hello");
    Wanted 2 times:
    -> at rx.internal.operators.OperatorMergeDelayErrorTest.testErrorInParentObservableDelayed(OperatorMergeDelayErrorTest.java:516)
    But was 1 time:
    -> at rx.observers.TestObserver.onNext(TestObserver.java:78)
        at rx.internal.operators.OperatorMergeDelayErrorTest.testErrorInParentObservableDelayed(OperatorMergeDelayErrorTest.java:516)

No idea why or if it's related, but I'd like to understand before merging this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjchristensen benjchristensen added this to the 1.0 milestone Nov 12, 2014
@akarnokd

akarnokd commented Nov 12, 2014

Copy link
Copy Markdown
Member Author

I don't think MergeDelayError uses ReplaySubject.

I don't fully understand the OperatorMerge, but it contains a lot of mutable variables and synchronized blocks and I'm not sure but I found some anomalies in:

https://github.com/ReactiveX/RxJava/blob/1.x/src/main/java/rx/internal/operators/OperatorMerge.java#L505

It synchronizes on the MergeProducer's this but reads the MergeSubscriber's wip field which generally is accessed through the MergeSubscriber's this. Same seems to be true for the scalarValueQueue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjchristensen

benjchristensen commented Nov 15, 2014

Copy link
Copy Markdown
Member

I've tested things locally and it's working for me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjchristensen benjchristensen mentioned this pull request Nov 15, 2014
Possible Thread Safety Issue in Merge #1885
Closed
@benjchristensen

benjchristensen commented Nov 15, 2014

Copy link
Copy Markdown
Member

I opened an issue to track the issue you brought up regarding merge: #1885

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

benjchristensen added a commit that referenced this pull request Nov 15, 2014
@benjchristensen
Merge pull request #1866 from akarnokd/ReplaySubjectMemoryLeakFix
d6cbf59
Fix memory leak in bounded ReplaySubject due to retaining the node index
@benjchristensen
benjchristensen merged commit d6cbf59 into ReactiveX:1.x Nov 15, 2014
@akarnokd
akarnokd deleted the ReplaySubjectMemoryLeakFix branch November 17, 2014 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@akarnokd @benjchristensen
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.