[browser][coreCLR] reduce initial memory footprint#127905
[browser][coreCLR] reduce initial memory footprint#127905pavelsavara wants to merge 1 commit intodotnet:mainfrom
Conversation
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this comment.
Pull request overview
This PR reduces the default WebAssembly memory and stack settings used by the CoreCLR browser host, aiming to lower the initial memory footprint during startup (per #127880).
Changes:
- Decrease Emscripten
INITIAL_MEMORYfrom 128 MB to 32 MB forbrowserhost. - Decrease Emscripten
STACK_SIZEfrom 5 MB to 2 MB forbrowserhost. - Keep the MSBuild CoreCLR WASM relink targets in sync with the
browserhostCMake configuration.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/native/corehost/browserhost/CMakeLists.txt | Lowers default INITIAL_MEMORY and STACK_SIZE link options for the browser host to reduce startup footprint. |
| src/mono/browser/build/BrowserWasmApp.CoreCLR.targets | Mirrors the updated memory/stack defaults in the CoreCLR WASM relink pipeline so app relinks match the host configuration. |
radekdoulik
left a comment
There was a problem hiding this comment.
LGTM, let see if CI tests will pass. Thank you!
|
There are more places where this is hardcoded: Is this inconsistency intentional? |
Yes, that is Mono |
|
What's the reasoning behind lower limits for CoreCLR? Is there a problem with applying the same lower limits to Mono as well? |
It's "see how low we can set it before things break".
The 32MB is matching Mono default value. I remember you said <20MB should be possible. Do you want to try that ? Blazor template app uses 84MB large linear memory to start on this branch.
Mono AOT in particular has big Right now Mono is "don't touch it" territory. @jkotas do you have specific concern or just curiosity ? |
Fixes #127880