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

Fix Generate (timed) crash upon disposing a long sequence #1067

Merged
merged 2 commits into from Nov 4, 2019

Conversation

akarnokd
Copy link
Collaborator

Due to how recursive scheduling has to link up IDisposables in the UserWorkItem class, a long running timed Generate would produce a long chain of UserWorkItems and crash with stack overflow if the whole sequence itself is disposed.

The fix is to have the recursive scheduling in Generate not return the next step's IDisposable from the function but keep replacing a main reference with the newer and newer IDisposables, and thus no link chain is formed.

The use of the SAD indirection is necessary because when the Schedule returns with the IDisposable, the payload may have already run and we would overwrite a newer step's IDisposable.

@khellang
Copy link
Member

khellang commented Dec 4, 2019

Thanks for fixing this memory leak. This is what my app looked like with 4.1.0:

image

And this is what it looks like now (with 4.3.0-preview.53):

image

Any clue when this will be part of an official release?

@khellang
Copy link
Member

khellang commented Dec 5, 2019

I left the app running over night with the newly released 4.3.1 release and this is the result:

image

Thanks again for fixing this and cutting a release so swiftly 😘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants