This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[web] Start with a smaller memory allocation for CanvasKit#56900
Merged
auto-submit[bot] merged 2 commits intoflutter:mainfrom Dec 4, 2024
Merged
[web] Start with a smaller memory allocation for CanvasKit#56900auto-submit[bot] merged 2 commits intoflutter:mainfrom
auto-submit[bot] merged 2 commits intoflutter:mainfrom
Conversation
yjbanov
reviewed
Dec 2, 2024
skia/modules/canvaskit/BUILD.gn
Outdated
| "-sMODULARIZE", | ||
| "-sNO_EXIT_RUNTIME=1", | ||
| "-sINITIAL_MEMORY=128MB", | ||
| "-sINITIAL_MEMORY=64MB", |
Contributor
There was a problem hiding this comment.
Wondering if should try 32MB. Worst case it will cost one extra 32 => 64 reallocation, and that's not too big.
Contributor
There was a problem hiding this comment.
does this memory allocation size include textures and the onscreen render target? For reference, the initial heap size for just CPU allocations we use for Android is 4MB
Contributor
There was a problem hiding this comment.
oh this is for the entire wasm heap? maybe 4MB isn't quite enough...
Contributor
There was a problem hiding this comment.
Good question. I imagine (hope?) that most textures and render targets bypass the wasm heap.
Contributor
Author
|
The default was to grow the memory by 20% each time. I changed it to grow by doubling to let rich apps reach their memory needs faster. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Dec 4, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Dec 5, 2024
github-merge-queue bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Dec 5, 2024
flutter/engine@9e8fcad...8d3c718 2024-12-04 [email protected] [Impeller] remove extra validation checks in GLES backend. (flutter/engine#56944) 2024-12-04 [email protected] Remove LSAN supressions for Linux embedder (flutter/engine#56913) 2024-12-04 [email protected] [web] Start with a smaller memory allocation for CanvasKit (flutter/engine#56900) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nick9822
pushed a commit
to nick9822/flutter
that referenced
this pull request
Dec 18, 2024
…ngine#56900) Confirmed that a sample Flutter app starts with a 32MB memory allocation for CanvasKit instead of 128MB. | Before | After| |-|-| |  |  | Fixes flutter#159499 <hr> Relevant emscripten settings: - [`INITIAL_MEMORY`](https://emscripten.org/docs/tools_reference/settings_reference.html#initial-memory) - [`ALLOW_MEMORY_GROWTH`](https://emscripten.org/docs/tools_reference/settings_reference.html#allow-memory-growth) - [`MEMORY_GROWTH_GEOMETRIC_STEP`](https://emscripten.org/docs/tools_reference/settings_reference.html#memory-growth-geometric-step) - [`MEMORY_GROWTH_GEOMETRIC_CAP`](https://emscripten.org/docs/tools_reference/settings_reference.html#memory-growth-geometric-cap) - [`ABORTING_MALLOC`](https://emscripten.org/docs/tools_reference/settings_reference.html#aborting-malloc) Relevant emscripten code: - https://github.com/emscripten-core/emscripten/blob/58889f9f20f74d0dbaed7d49025c49b864359ae1/src/library.js#L290 - Emscripten tries to grow memory by the provided growth factor. If it fails, it tries to grow by 50% of that amount. If it fails, it tries 25%. Then it gives up and fails gracefully.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Confirmed that a sample Flutter app starts with a 32MB memory allocation for CanvasKit instead of 128MB.
Fixes flutter/flutter#159499
Relevant emscripten settings:
INITIAL_MEMORYALLOW_MEMORY_GROWTHMEMORY_GROWTH_GEOMETRIC_STEPMEMORY_GROWTH_GEOMETRIC_CAPABORTING_MALLOCRelevant emscripten code: