Skip to content

High memory usage in Blazor app, when built with wasm-tools workload installed #73949

@ysmoradi

Description

@ysmoradi

Is there an existing issue for this?

  • I have searched the existing issues

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:
image
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:
image

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 pipeline
It also reduces download size about 0.5MB when I use <InvariantGlobalization>true</InvariantGlobalization>

Metadata

Metadata

Assignees

Labels

arch-wasmWebAssembly architecturearea-VM-meta-mononeeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsideration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions