microsoft / microsoft/microsoft-ui-xaml
`ConnectedAnimation` causes memory leak
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
Trigger `ConnectedAnimation` repeatedly, memory usage will increase steadily.
### Why is this important?
Frequent operations can cause a crash.
### Steps to reproduce the bug
There are two ways to reproduce this:
The first one:
1. Debug attached solution: [ConnectedAnimationMemoryLeak.zip](https://github.com/user-attachments/files/30036901/ConnectedAnimationMemoryLeak.zip)
2. Click repeatedly rectangle with text leak.
3. Observe Process Memory in Diagnostic Tools
The second one:
1. Open WinUI 3 Gallery
2. Open Task Manager, search WinUI 3 Gallery
3. Go to Motion > Connected Animation
4. Locate to first sample, click Item 1 and Go Back repeatedly.
5. Check memory usage in Task Manager.
### Actual behavior
Process memory usage increase steadily.
### Expected behavior
No memory leak.
### Screenshots
### NuGet package version
2.2.1
### Windows version
Windows 11 (26H1): Build 28000
### Additional context
_No response_
Contributor guide
Research direction
Start with the attached ConnectedAnimationMemoryLeak.zip and reproduce the leak by repeatedly clicking the rectangle. Compare this with the WinUI 3 Gallery Motion > Connected Animation sample while monitoring memory in Diagnostic Tools or Task Manager. Done means repeated navigation no longer causes process memory to increase steadily.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100