PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Memory leak when previewing images with Peek

Open daverayment opened this issue 1 year ago • 2 comments

Microsoft PowerToys version

0.81.1

Installation method

PowerToys auto-update

Running as admin

No

Area(s) with issue?

Peek

Steps to reproduce

  1. Navigate to a folder containing a selection of images. (The bug seems to occur with any number of images in the folder.)
  2. Click on any image and use the Ctrl+Space shortcut to open Peek.
  3. 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:

image

After navigating through 500 images using the arrow keys, the tool uses ~1.4GB:

image

Some notes:

  1. Closing the tool does not free up the used memory.
  2. Leaving the system idle does not free up the used memory (I waited 30 minutes).
  3. Using Peek again after closing it does not free up the used memory.
  4. 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

daverayment avatar Jul 02 '24 11:07 daverayment

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:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jul 02 '24 11:07 github-actions[bot]

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

crutkas avatar Jul 02 '24 23:07 crutkas

This issue has been worked on during the 0.85 development cycle. Please update to the latest release.

jaimecbernardo avatar Oct 07 '24 08:10 jaimecbernardo