Skip to content

Fix memory leaks in eager API #223

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

Merged
merged 5 commits into from
Jul 22, 2021
Merged

Fix memory leaks in eager API #223

merged 5 commits into from
Jul 22, 2021

Conversation

jpsamaroo
Copy link
Member

We need to ensure that we allow eager-allocated Thunks to become unreferenced by the scheduler when they're no longer needed, so that they and their inputs can be subject to GC.

This also fixes a memory leak caused by the dynamic listener not terminating with its associated scheduler, resulting in a leak of the entire ComputeState.

@jpsamaroo
Copy link
Member Author

Fixes #225

Ensure that unreachable thunks are cleaned up by GC
Make `add_thunk!` interrupt sleeping scheduler
Allow registering eager thunks and single future in `add_thunk!`
Make Dagger.spawn synchronous
Remove redundant `dependents` and `finished` fields from ComputeState
@jpsamaroo jpsamaroo force-pushed the jps/eager-mem-leak-fix branch from 08b37db to 922dfa2 Compare July 22, 2021 20:32
@jpsamaroo jpsamaroo merged commit 5ccbd87 into master Jul 22, 2021
@jpsamaroo jpsamaroo deleted the jps/eager-mem-leak-fix branch July 22, 2021 20:32
@jpsamaroo
Copy link
Member Author

I've merged this to fix a number of bugs, but it's not yet at 100% because we still get some memory leaks (hence why we have @test_broken statements).

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.

1 participant