Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: WebView2 control throws OutOfMemoryException on call to EnsureCoreWebView2Async() #4601

Open
tflopez opened this issue May 30, 2024 · 6 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@tflopez
Copy link

tflopez commented May 30, 2024

What happened?

Our WinUI 3 (WindowsAppSdk) app allows users to navigate to various pages to define a model, compute, and review tabular and graphic outputs. Some of these pages have WebView2 controls on them to show their content. Once we've loaded a WebView2 control 252 times, the 253rd attempt throws an OutOfMemory exception when we call EnsureCoreWebView2Async() when initializing the WebView2 control.

This was tested with the following configurations with the same behavior:

  • Windows 10 (10.0.19045), WebView Runtime 125.0.2535.67 and 124.0.2478.109
  • Windows 11 (10.0.22631), WebView Runtime 125.0.2535.67

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

125.0.2535.67, 124.0.2478.109

SDK Version

1.0.2210.55

Framework

WinUI3/WinAppSDK

Operating System

Windows 10, Windows 11

OS Version

10.0.19045, 10.0.22631

Repro steps

  • Run the attached application's Debug|x86 unpackaged configuration
  • Click on a NavigationViewItem to load a page containing a single WebView2 control
  • Continue clicking on a NavigationViewItem to load subsequent pages
  • Once you start to load the 253rd page, it will crash with an OutOfMemory exception when the page calls the WebView2's EnsureCoreWebView2Async() method.

WebViewTest.zip

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

AB#51806338

@tflopez
Copy link
Author

tflopez commented Jun 13, 2024

Is this the right repository for this issue? If not, I can open it in another one (WindowsAppSdk?) if that's a more appropriate place. Thank you!

@victorhuangwq
Copy link
Collaborator

Can I ask, if you have specific reasons to believe that this is something that is WebView2 related, instead of WindowsAppSdk?
No worries if you don't, however.

@tflopez
Copy link
Author

tflopez commented Jun 14, 2024

Can I ask, if you have specific reasons to believe that this is something that is WebView2 related, instead of WindowsAppSdk? No worries if you don't, however.

Sorry, I don't really have any specific reason to think it's one or the other. I'm hoping it won't take too long for someone familiar with the code to be able to tell and point me in the right direction. Thanks again!

@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Jun 14, 2024
@LiangTheDev
Copy link
Member

Thanks a lot for the repro. It is a WebView2 issue. We'll investigate and update.

@tflopez
Copy link
Author

tflopez commented Jul 5, 2024

Thanks a lot for the repro. It is a WebView2 issue. We'll investigate and update.

Have you had any luck tracking this down? Please let me know if there's anything else I can do to make it easier to investigate this issue. Thank you!

@LiangTheDev
Copy link
Member

We are still investigating the issue. It is related to something in the OS itself and might take longer to address. The repro really helps and we have enough clue to investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

3 participants