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

Blazor WebAssembly crashes on mobile devices with low RAM #61925

Closed
martinmogusu opened this issue Nov 16, 2021 · 25 comments
Closed

Blazor WebAssembly crashes on mobile devices with low RAM #61925

martinmogusu opened this issue Nov 16, 2021 · 25 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono
Milestone

Comments

@martinmogusu
Copy link

Describe the bug

Blazor WebAssembly apps crash on devices with low RAM

To Reproduce

I have created a minimal example at https://github.com/martinmogusu/CrashTest
The code is from the default WebAssembly template dotnet new blazorwasm

I have also hosted the site on Azure Static Web Apps here: https://icy-sky-0892af903.azurestaticapps.net/

If you load the site on a device with 1GB RAM, the app crashes. On the UI you see "An unhandled error has occurred"
On the browser console logs you find this error:

Uncaught (in promise) TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read

TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read
window.Module.s.printErr @ blazor.webassembly.js:1

I was able to view the console logs by using Kiwi Browser for android, which has devtools.
The same site works okay on devices with higher RAM.

Further technical details

  • ASP.NET Core version: 6.0
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: Visual studio 2022
  • Include the output of dotnet --info:
dotnet --info Output
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  3.1.301 [C:\Program Files\dotnet\sdk]
  3.1.415 [C:\Program Files\dotnet\sdk]
  5.0.403 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.1.21463.6 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
@TanayParikh
Copy link
Contributor

Were you seeing a crash in Chrome as well? Supported browsers are listed here: https://docs.microsoft.com/en-us/aspnet/core/blazor/supported-platforms?view=aspnetcore-6.0. Note, Kiwi isn't on the list of supported browsers.

@martinmogusu
Copy link
Author

Yes, I'm seeing the crash on Chrome on Android as well. I'm using the latest version of chrome (95.0.4638.74)

@frieddumplings
Copy link

frieddumplings commented Nov 20, 2021

Also seeing it in chrome beta/android 97.0.4692.20.

The website just gives the "An unhandled error has occured. Reload" message - (clicking on reload for me dosen't actually do anything).

.Net Core 6.0 empty/default client/server project (nothing changed).

Using a VPS that has 2GB of ram to host my page (Just the default client/server template) . It seems to be okay when navigating normally using buttons/clicking on links, but if I modify the url through the search bar (by typing) I get this error quite frequently. Phone is a Galaxy S9 SM-G960F running android 10.

I've tested on an older version of chrome as well (80.0.3987.99) and its harder(?) or almost impossible to reproduce the error.

edit (this older version was chrome stable)
(Also forgot to mention, blazor project. If that makes any difference).

Screenshot_8

(Edit again: Added a list of server processes) CPU** and ram usage hovers around 30~50%. Haven't really monitored when changing pages but shouldnt(?) be an issue, nothing fancy installed. Just SQLServer and a bunch of default stuff)

Screenshot_2
Screenshot_3

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Nov 22, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 22, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@mkArtakMSFT
Copy link
Member

@lewing FYI

@frieddumplings
Copy link

Screenshot_5

Possibly related, this was also in the debug window when the above errors showed up in the console:
https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html
https://blog.chromium.org/2021/09/user-agent-reduction-origin-trial-and-dates.html

@ghost
Copy link

ghost commented Nov 24, 2021

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

Describe the bug

Blazor WebAssembly apps crash on devices with low RAM

To Reproduce

I have created a minimal example at https://github.com/martinmogusu/CrashTest
The code is from the default WebAssembly template dotnet new blazorwasm

I have also hosted the site on Azure Static Web Apps here: https://icy-sky-0892af903.azurestaticapps.net/

If you load the site on a device with 1GB RAM, the app crashes. On the UI you see "An unhandled error has occurred"
On the browser console logs you find this error:

Uncaught (in promise) TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read

TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read
window.Module.s.printErr @ blazor.webassembly.js:1

I was able to view the console logs by using Kiwi Browser for android, which has devtools.
The same site works okay on devices with higher RAM.

Further technical details

  • ASP.NET Core version: 6.0
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: Visual studio 2022
  • Include the output of dotnet --info:
dotnet --info Output
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  3.1.301 [C:\Program Files\dotnet\sdk]
  3.1.415 [C:\Program Files\dotnet\sdk]
  5.0.403 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.1.21463.6 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
Author: martinmogusu
Assignees: -
Labels:

untriaged, area-VM-meta-mono

Milestone: -

@radical radical added the arch-wasm WebAssembly architecture label Nov 24, 2021
@ghost
Copy link

ghost commented Nov 24, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Describe the bug

Blazor WebAssembly apps crash on devices with low RAM

To Reproduce

I have created a minimal example at https://github.com/martinmogusu/CrashTest
The code is from the default WebAssembly template dotnet new blazorwasm

I have also hosted the site on Azure Static Web Apps here: https://icy-sky-0892af903.azurestaticapps.net/

If you load the site on a device with 1GB RAM, the app crashes. On the UI you see "An unhandled error has occurred"
On the browser console logs you find this error:

Uncaught (in promise) TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read

TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read
window.Module.s.printErr @ blazor.webassembly.js:1

I was able to view the console logs by using Kiwi Browser for android, which has devtools.
The same site works okay on devices with higher RAM.

Further technical details

  • ASP.NET Core version: 6.0
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: Visual studio 2022
  • Include the output of dotnet --info:
dotnet --info Output
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  3.1.301 [C:\Program Files\dotnet\sdk]
  3.1.415 [C:\Program Files\dotnet\sdk]
  5.0.403 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.1.21463.6 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
Author: martinmogusu
Assignees: -
Labels:

arch-wasm, untriaged, area-VM-meta-mono

Milestone: -

@lewing lewing added this to the .NET 7.0 milestone Nov 29, 2021
@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Nov 29, 2021
@karelz karelz modified the milestones: .NET 7.0, 7.0.0 Nov 30, 2021
@ldsenow
Copy link

ldsenow commented Dec 19, 2021

I am not sure mine have the same root cause as yours. I ran a memory profile on chrome desktop version with .net 6 wasm published to IIS. The barebone template project is using 540mb memory compare to .net 5's 40mb. It is unacceptably high memory usage on a almost blank project. It is causing the whole application crashes after a few operations. I hope someone can take this seriously. It is NOT a small issue.

Please refer to the issue below. The issue is not reported by me but I have the same symptom and I uploaded a few screenshots.

#62054

P.S. .net 6 + wasm + kestrel (ctrl + F5 via VS) is not having this memory issue.

@radical radical modified the milestones: 7.0.0, 8.0.0 Aug 12, 2022
@s21-himesh
Copy link

Is there any update on this issue. We have run into the same thing. Looks like it's not going to be fixed in .net 7 and pushed out to .net 8. Has anyone got any workarounds for this? At the moment there looks like no other solution but to pull back to .net 5.

MS guys on ticket, this is hardly a small issue is it. There are many devices with low ram

@Pethical
Copy link

Hi folks,
We ran into this issue, a Samsung Galaxy A52 is not enough to run a webassembly app. We are using .net 6.
Why the milestone is .NET 8? This is a serious bug, blazor is unusable on a normal consumer mobile devices, and opened a year ago.
Isn't NET 6 the current LTS stable release?
Really need to rollback to the unsupported net 5 to get work blazor on consumer mobile phones?

@dbridgman
Copy link

Hi all

I wanted to chime into this issue more, because I believe it's much more serious than MS believe it to be. Other people in this thread have been using relatively low-end phones, but I've tested this across a variety of devices, not just low end but iPhone 11, and some flagship samsung phones that're a bit older. I believe the threshold is devices 4gb and below.

I've taken an empty blazor WASM project and deployed it to azure, nothing fancy, no additions, no nothing, just a plain Blazor WASM app.

The initial load is absolutely shocking, hitting a second by second usage of 1.91GB of ram. It absolutely should not be hogging this amount of memory.

initial load

From this point on you can force an exception simply by refreshing the page, where you can see the max usage hits 3.26gb of RAM. Which again is madness for just an empty app.

max memory load after refresh

When hitting this amount it hits an exception:

deployed-site-exceptiob

Now I get the iphone 11 is hardly a new phone being released in 2019, but reality is, this is this is reflective of most people walking around with a mobile device today.

This needs a fix, at the moment I'd actively discourage anyone that's developing for mobile users to avoid using Blazor WASM until it's fixed.

@ldsenow
Copy link

ldsenow commented Oct 18, 2022

Not supprised by this if your using net 6 blazor wasm. A few issues have been reported around memory leaks and crashes. Barely have any of them been fixed. We have to use.net 5 which is at least not broken. It has been like this for a year and not sure this will be resolved in.net 7 or not.

@pmedina61920
Copy link

I had the same problem, I fixed it by removing all OnAfterRenderAsync methods, I don't know the root cause but it worked for me.

@mtranchi
Copy link

I'm having the same issue. No way can I use Blazor 6 or 7 until this is fixed. This is a major issue.

@ghost
Copy link

ghost commented Dec 21, 2022

I am having the same issue. To say that this is major is an understatement....

@pavelsavara
Copy link
Member

I will spend some time next year on looking on this, but for now some hints:

  1. Browsers can't do streaming wasm instantiation when content type HTTP header is wrong. That consumes more memory. See also WebAssembly compilation fallback logic is wrong. May need some further docs about configuring memory limits. aspnetcore#42055
  2. you could use <EmccTotalMemory>xxx</EmccTotalMemory> in your .csproj file together with <WasmBuildNative>true</WasmBuildNative> or with AOT. Where xxx is memory size which still works for your app.

Remember that memory requirements of your app is not all we need here. We also expand IL->IR for interpreted methods. And the browser JIT will have to compile all the code too, consuming CPU and memory.

Perhaps for low powered mobile devices, consider server side rendering, where possible.
Maybe we should define some minimal spec on which WASM is supported.

@Pethical
Copy link

The headers are ok in my application. I have a Samsung Galaxy Note 10+ phone and the application can't load because this problem. If this is a low powered phone, then please tell me what is a high end device. And what can I define as minimum spec? A phone with 64Gb ram and 32 arm cores? 😅
Basically, net 5 is working like a charm, so I downgraded my apps. This is a security flaw and can cause problems, but no other way exists. The net 5 is the Windows XP today. We can't upgrade. 😂

@pavelsavara
Copy link
Member

Did EmccTotalMemory help?

@ghost
Copy link

ghost commented Dec 26, 2022

@pavelsavara

  1. you could use <EmccTotalMemory>xxx</EmccTotalMemory> in your .csproj file together with <WasmBuildNative>true</WasmBuildNative> or with AOT. Where xxx is memory size which still works for your app.

This helped in my case. I've gone from seeing 3.5-4gb of memory consumed within a few actions to under 1gb.

Thank you

@boukenka
Copy link

@simpsoc Which value did you define for xxx?

<EmccTotalMemory>xxx</EmccTotalMemory>

@ghost
Copy link

ghost commented Dec 27, 2022

@simpsoc Which value did you define for xxx?

<EmccTotalMemory>xxx</EmccTotalMemory>

@boukenka

I set it to 16777216(1024(bytes) x 1024(kilobytes) x 16 = 16MB).

I had seen another post that was mostly msft engineers discussing the issue earlier in the year. I think I initially found it by searching my specific error message. This was a value that someone mentioned fixing the issue in their testing. The discussion seemed to mostly focus around implementing the ability to make the change vs the change already being something that could be made. I did some googling around EmccTotalMemory and webassembly, blazor, wasm keywords but the only results I found were for emscripten, which is a 3rd party webassembly compiler that is used for building the webassembly. Without any results or documentation focusing around blazor i didn't realize it was a configurable parameter. @pavelsavara suggesting changing that value in csproj and adding the native build flag is as close to any instructions or documentation as I've seen for this. His suggestion triggered my memory to go back and look at that thread for the value they'd used.

@pavelsavara
Copy link
Member

pavelsavara commented Jan 5, 2023

Searching for Module["INITIAL_MEMORY"] in the final dotnet.js gives me following answers for vanilla Blazor template

  • net6, release, no AOT, no relink: 16777216
  • net7, release, no AOT, no relink: 16777216
  • net8, release, no AOT, no relink: 536870912
  • net6, release, relink: 536870912
  • net7, release, relink: 536870912
  • net8, release, relink: 536870912

It is set here

<EmccInitialHeapSize Condition="'$(EmccInitialHeapSize)' == ''">$(EmccTotalMemory)</EmccInitialHeapSize>
<EmccInitialHeapSize Condition="'$(EmccInitialHeapSize)' == ''">536870912</EmccInitialHeapSize>

and applies for customers anytime they do relink (even without AOT) for example via <WasmBuildNative>true</WasmBuildNative>
or by just having wasm-tools workload installed!

workload will pass --initial-memory=536870912 to emcc

this is probably the PR which introduced it #52941 which is Net6 timeframe

I was not able to replicate the issue with the repro repo without relink.

@pavelsavara
Copy link
Member

pavelsavara commented Jan 5, 2023

questions: @radical @lewing @maraf @kg

  • what should be the default value for no-relink (no workload)
  • what should be the default value for relink
  • what should be the default value for AOT
    • I suspect we increased it for some reasons with AOT builds and re-link is just side effect ?
    • why did we go for such large value ?
  • Should we create patch for net7 ?
  • Should we create patch for net6 ?

Same questions as in #66313

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 19, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 8, 2023
@pavelsavara
Copy link
Member

Fixed by #80849

@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono
Projects
None yet
Development

No branches or pull requests