Skip to content

Commit 17f3ee7

Browse files
authored
Merge pull request #824 from unoplatform/dev/jela/doc-initialmemory
docs: Clarify initial_memory
2 parents 8a7d79d + c82af6e commit 17f3ee7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/runtime-execution-modes.md

+18
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,24 @@ In order to determine which methods are still using the interpreter, you can use
147147

148148
The logs from the AOT compiler can be found in [binlogs generated](https://aka.platform.uno/msbuild-troubleshoot) from the build.
149149

150+
### Increasing the Initial Memory Size
151+
152+
When building with Mixed AOT/Interpreter modes, the initial memory may need to be adjusted in the project configuration if the following error message appears:
153+
154+
```
155+
wasm-ld: error: initial memory too small, 17999248 bytes needed
156+
```
157+
158+
In order to fix this, you'll need to set the [`INITIAL_MEMORY`](https://emscripten.org/docs/tools_reference/settings_reference.html?highlight=initial_memory#initial-memory) emscripten parameter, this way:
159+
160+
```xml
161+
<ItemGroup>
162+
<WasmShellExtraEmccFlags Include="-s INITIAL_MEMORY=64MB" />
163+
</ItemGroup>
164+
```
165+
166+
which will set the initial memory size accordingly. Note that setting this value to a sufficiently large value (based on your app's usual memory consumption) can improve the startup performance.
167+
150168
## Required configuration for AOT, Mixed Mode or external bitcode support compilation on Windows 10
151169

152170
### Native windows tooling

0 commit comments

Comments
 (0)