microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Unhandled Excpetion in ui.xaml.dll when displaying a large set of images

Open orels1 opened this issue 3 years ago • 0 comments

Describe the bug

I'm making an image-tagging/organizing app and thus need to display a lot of images together.

But I'm hitting a hard blocker so far - the app crashes if you scroll through the list too fast.

I tried both GridView and ItemsRepeater in both Release and Debug mode - and I just get a very opaque crash coming from within ui.xaml.dll with no real way to stacktrace every time user grabs the scrollbar and drags it back and forth for a second.

It seems like the magic number is 1.39 GBs of RAM, as soon as you scroll fast enough for the GridView to load all those thumbnails into ram to fill it up - it crashes. If you scroll slower - the GC kicks in before it can reach that point and the app survives.

Steps to reproduce the bug

Follow this tutorial

And load at least 100 images, in my case i repro the crash at around 150 almost every time I try to drag the scrollbar, and at 100 with a bit of effort.

Launch the app and drag the scrollbar back and forth, or just scroll really fast.

You should get a crash.

Expected behavior

The application should not crash

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.1.4

Windows app type

  • [ ] UWP
  • [X] Win32

Device form factor

Desktop

Windows version

Windows 11 (21H2): Build 22000

Additional context

Tested on AppSDK 1.1.3,1.1.4 and 1.1.5

Also, if I drop the requested size of the thumbnail in the GetThumbnailAsync call to 50 - it doesnt crash anymore, but it hangs the application for 3-5 seconds if you scroll fast, but recovers afterwards.

orels1 avatar Sep 18 '22 19:09 orels1