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
22.03k stars 1.73k forks source link

net8 sr9 Win Platform Release Mode Memory leak when multiple windows get closed #24803

Open jingliancui opened 1 week ago

jingliancui commented 1 week ago

Description

1.App will crash in release mode when the memory increase more than 300M which is shown in task manager.

2.1Additional info for publish debug app: App will crash after 3 time to do : new 100 windows, then close all. Situation better then Release mode, but not better, due to my laptop has 50G Ram, but debug app will crash in about 400M

2.2Additional info for debug using VS: In the 3rd time to do : new 100 windows, then close all, VS show this image

Steps to Reproduce

1.Publish the release app: dotnet publish -f net8.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true

2.Open the APP

3.Input a number 50 to the Entry Control

4.Click the button "new windows"

5.Click the button "Close all windows"

Repeat step3 to step5 about 3 time, the app will crash

Link to public reproduction project repository

https://github.com/jingliancui/MAUIWinUIWinMemoryLeakIssue

Version with bug

8.0.90 SR9

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 1 week ago

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.

tj-devel709 commented 1 week ago

Hi @jonathanpeppers, do you have thoughts on this one?

jingliancui commented 1 week ago

I'm curious about in debug within vs #24802, it doesn't crash. Let me try if it will crash if publish using debug mode.

jingliancui commented 1 week ago

Additional info for publish debug app: App will crash after 3 time to do : new 100 windows, then close all. Situation better then Release mode, but not better, due to my laptop has 50G Ram, but debug app will crash in about 400M . Also updated this info to the first description.

jingliancui commented 1 week ago

Additional info for debug using VS: In the 3rd time to do : new 100 windows, then close all, VS show this image

ninachen03 commented 6 days ago

This issue has been verified using Visual Studio 17.12.0 Preview 2.0(8.0.90 & 8.0.3). Can repro this issue at windows platform.