Memory leak when previewing images with Peek
Microsoft PowerToys version
0.81.1
Installation method
PowerToys auto-update
Running as admin
No
Area(s) with issue?
Peek
Steps to reproduce
- Navigate to a folder containing a selection of images. (The bug seems to occur with any number of images in the folder.)
- Click on any image and use the Ctrl+Space shortcut to open Peek.
- Use the arrow keys to navigate through the images in the folder.
✔️ Expected Behavior
Peek navigates through the images contained within the folder and uses a reasonable amount of memory, related to the size of the individual images being previewed. Subsequent navigations through the same images use the same amount of memory, i.e. the maximum memory used for previewing the folder images does not increase.
❌ Actual Behavior
The memory used by the application increases and is never reclaimed, leading to increased memory pressure on the system.
When the first image is displayed, the tool uses ~150MB:
After navigating through 500 images using the arrow keys, the tool uses ~1.4GB:
Some notes:
- Closing the tool does not free up the used memory.
- Leaving the system idle does not free up the used memory (I waited 30 minutes).
- Using Peek again after closing it does not free up the used memory.
- I am using default settings and PowerToys is running in User mode.
Bug report logs: PowerToysReport_2024-07-02-12-19-16.zip
Other Software
No response
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
- Peek memory leak/does not clear memory after closing the window and after reaching a limit (#26162), similarity score: 0.88
- Peek images do not load when browsing (#28142), similarity score: 0.78
- "PowerToys.Peek.UI" keeps utilizing resources even while not in use. (#28501), similarity score: 0.77
- [Peek] Tooltip from previous file (#28010), similarity score: 0.77
- PowerToys Run Memory Leak (#29078), similarity score: 0.77
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I can repro this. Takes a bit with images but got it up to over 300mb and held. Quick glance at code "looks" like it does clean up but clearly it doesn't seem to.
We should validate all file times depending on fix
This issue has been worked on during the 0.85 development cycle. Please update to the latest release.