Skip to content

[CP] [vm] Fix leakage of file system watcher related data structures #52793

@srawlins

Description

@srawlins

Commit(s) to merge

3dd9389

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/311521

Issue Description

Without this fix, there is a bad leak of _Closure objects when using overlapping Directory.watch streams. This change switches a Stream.pipe usage to Stream.listen, and cancels subscriptions.

What is the fix

The fix is to change how these watch events are listened to, and canceling subscriptions.

Why cherry-pick

This memory leak can be very prevalent in the Dart analyzer, and memory usage (including leaks) is a top issue for users of Dart analyzer.

Risk

low

Issue link(s)

#52703

Extra Info

No response

Metadata

Metadata

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-mergedCherry-pick has been merged to the stable or beta branch.cherry-pick-reviewIssue that need cherry pick triage to approve

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions