-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
High memory usage in Blazor app, when built with wasm-tools
workload installed
#73949
Comments
dotnet workload install wasm-tools
wasm-tools
workload installed
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsIs there an existing issue for this?
Describe the bugIf I publish the default project template of the blazor web assembly app which has counter/weather/index pages using visual studio 17.3 stable and .net SDK 7 preview 7, the memory usage would be about 50 MB Expected BehaviorI'd expect the same behavior about memory usage, with or without wasm-tools Steps To ReproduceInstall VS 17.3 stable Exceptions (if any)No response .NET Version7.0.100-preview.7.22377.5 Anything else?Note that I've to install wasm-tools
|
What errors did you get without |
This issue has been marked |
1- Simply right click on the newly created blazor web assembly + aspnetcore backend project and perform 2- Will submit in separated responses 3- No particular error. I'd expect a size reduction in |
Microsoft Visual Studio Community 2022 Installed Version: Community Visual C++ 2022 00482-10000-00261-AA784 ASP.NET and Web Tools 17.3.375.53775 Azure App Service Tools v3.0.0 17.3.375.53775 Azure Functions and Web Jobs Tools 17.3.375.53775 C# Tools 4.3.0-3.22401.3+41ae77386c335929113f61d6f51f2663d2780443 Common Azure Tools 1.10 Extensibility Message Bus 1.2.6 (master@34d6af2) Microsoft Azure Tools for Visual Studio 2.9 Microsoft JVM Debugger 1.0 Mono Debugging for Visual Studio 17.3.20 (3f4cb00) NuGet Package Manager 6.3.0 Project System Tools 1.0 Razor (ASP.NET Core) 17.0.0.2232702+e1d654e792aa2fe6646a6935bcca80ff0aff4387 SQL Server Data Tools 17.0.62207.04100 TypeScript Tools 17.0.10701.2001 Visual Basic Tools 4.3.0-3.22401.3+41ae77386c335929113f61d6f51f2663d2780443 Visual F# Tools 17.1.0-beta.22363.4+1b94f89d4d1f41f20f9be73c76f4b229d4e49078 Visual Studio IntelliCode 2.2 VisualStudio.DeviceLog 1.0 VisualStudio.Mac 1.0 VSPackage Extension 1.0 Web Compiler 1.14.8 Xamarin 17.3.0.295 (d17-3@321c85a) Xamarin Designer 17.3.0.208 (remotes/origin/d17-3@e4f67afef) Xamarin Templates 17.2.28 (9b3d244) Xamarin.Android SDK 13.0.0.0 (d17-3/030cd63) Xamarin.iOS and Xamarin.Mac SDK 15.12.0.2 (87f98a75e) |
|
cc @BrzVlad |
Installing the workload enables relinking and another wasm-opt pass, I wonder if it is interacting with the gc in some way |
+1 |
Also hitting this issue, extremely long build times when using the Publish button to an Azure Virtual Machine, longer than 10 minutes - a local build on the Release configuration is finished in less than a minute. Memory usage for Visual Studio 2022 and .NET Host fluxuate wildly (up and down) with each up being higher than the last. As I type this it's up to 8.5GB Memory usage for Visual Studio and .NET Host is about 5GB and they keep rising. Now it's at 9.3GB and 6.5GB. Now 11.4GB and 8GB. . Using Visual Studio 2022 Preview (17.5.0 Preview 1.0). Note: I also get the same long build time and high memory issue when I Publish to a folder, it's not the publish step that's the issue. Update: I switched back to Visual Studio 2022 17.4 and still encountered the issue. BUT I manage to "fix" it by turning off trimming in both the Client and Server projects. 18 minutes down to 3 minutes and most of that 3 minutes was the actual file upload. It was getting stuck on illink in the build output. Unfortunately without playing further I'm currently left without trimming. |
I think it's duplicate of #61925 |
Fixed by #80849 |
Is there an existing issue for this?
Describe the bug
If I publish the default project template of the blazor web assembly app which has counter/weather/index pages using visual studio 17.3 stable and .net SDK 7 preview 7, the memory usage would be about 50 MB
But afterI install the wasm-tools workload, the memory usage increases significantly (about 540MB which is 10X more memory usage and the app becomes slower in the initialization phase by about 1 second)
Expected Behavior
I'd expect the same behavior about memory usage, with or without wasm-tools
Steps To Reproduce
Install VS 17.3 stable
Install .NET 7 preview 7
Enable using preview versions of .NET SDK in VS
Create a new blazor web assembly project
Publish that and run that and then use chrome dev tools to take a heap snapshot
The memory usage would be something like this:
Install wasm-tools using
dotnet workload install wasm-tools
Close / Open Visual Studio
Publish that app again and run that and then use chrome dev tools to take a heap snapshot
The memory usage would be something like this:
Exceptions (if any)
No response
.NET Version
7.0.100-preview.7.22377.5
Anything else?
Note that I've to install wasm-tools
Without that, I'm unable to build blazor web assembly projects using
dotnet build
command in CI/CD pipelineIt also reduces download size about 0.5MB when I use
<InvariantGlobalization>true</InvariantGlobalization>
The text was updated successfully, but these errors were encountered: