fix: migrate to AsyncIterableProducer in terminal shell integration to avoid memory leaks#307868
fix: migrate to AsyncIterableProducer in terminal shell integration to avoid memory leaks#307868Diode11-Alt wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…alShellIntegration.ts to resolve memory leaks.
|
@Diode11-Alt please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
@Diode11-Alt please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Summary
This PR migrates
AsyncIterableObjectusage inextHostTerminalShellIntegration.tstoAsyncIterableProducer.Rationale
AsyncIterableObjectbuffers all emitted values indefinitely, which leads to memory leaks in single-consumption scenarios like terminal shell execution data streams.AsyncIterableProduceris a more memory-efficient alternative that doesn't buffer values.Changes
AsyncIterableObjectwithAsyncIterableProducerinShellExecutionDataStream.InternalTerminalShellExecution._createDataStreamto useAsyncIterableProducer.EMPTY.ShellExecutionDataStream.flush()to wait for the completion barrier instead of draining the iterable with.toPromise().