Summary
In crates/cli/src/outline/extract.rs, the stream_paths function (around line 140) uses an unbounded mpsc::channel to pass OutlineFile payloads from a parallel producer to a sequential consumer. On large repos, parallel walkers can enqueue many full file payloads before the consumer processes them, causing significant memory spikes.
Suggested fix
Replace the unbounded channel with a bounded sync_channel to apply backpressure to producers:
const OUTLINE_QUEUE_BOUND: usize = 256;
let (tx, rx) = mpsc::sync_channel(OUTLINE_QUEUE_BOUND);
This limits the number of queued OutlineFile items, slowing producers when the queue is full rather than accumulating unbounded memory.
References
/cc @HerringtonDarkholme
Summary
In
crates/cli/src/outline/extract.rs, thestream_pathsfunction (around line 140) uses an unboundedmpsc::channelto passOutlineFilepayloads from a parallel producer to a sequential consumer. On large repos, parallel walkers can enqueue many full file payloads before the consumer processes them, causing significant memory spikes.Suggested fix
Replace the unbounded channel with a bounded
sync_channelto apply backpressure to producers:This limits the number of queued
OutlineFileitems, slowing producers when the queue is full rather than accumulating unbounded memory.References
/cc @HerringtonDarkholme