dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.99k stars 1.72k forks source link

Cache Memory keeps increasing when taking photo using "Microsoft.Maui.Media.MediaPicker.CapturePhotoAsync() " causing app to Crash #21914

Open thanigaiharan opened 4 months ago

thanigaiharan commented 4 months ago

Description

when we taking photo (multiple photos) using "Microsoft.Maui.Media.MediaPicker.CapturePhotoAsync() " the cache memory of the application keeps increasing (~22 MB for each photo) in both IOS and Android. it causing app to Crash while we take more number of photos.

Steps to Reproduce

You can try with the sample application provided here for Media Picker .

https://learn.microsoft.com/en-gb/samples/dotnet/maui-samples/platformintegration-essentials/

Link to public reproduction project repository

No response

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms, Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

RoiChen001 commented 4 months ago

Can't repro this issue at Android device on the latest 17.10.0 Preview 4(8.0.7&8.0.20).

thanigaiharan commented 4 months ago

@samhouts we can Still able to reproduce the issue (Checking with Android Device) with the sample Project provided above.

using .NET SDK 8.0.204 , MAUI Controls 8.0.20, CommunityToolkit.MAUI 8.0.1.

emersonefc commented 3 weeks ago

I'm having the same problem. With the increase in memory, the app restarts or crashes after taking a few photos. I'm using SDK 8.0, MAUI controls 8.0.72 Any solutions?