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

sinkToSource: transfer data in chunks and release memory early #12255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NaN-git
Copy link

@NaN-git NaN-git commented Jan 14, 2025

Motivation

This PR adds a ring buffer to SinkToSource, so that the size of allocated memory is limited, and the memory is released as soon as possible. Furthermore the coroutine can continue before all data is read from the ring buffer.

Also the max. amount of data passed per coroutine call in sourceToSink is limited.

Context

The current behavior can introduce bubbles in a pipeline of coroutines and memory usage can become an issue, especially if SinkToSource instances have a longer than necessary life time.

Should fix #7359


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@NaN-git NaN-git requested a review from edolstra as a code owner January 14, 2025 22:14
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.

Copying lots of paths fails with "too many root sets"
1 participant