Emscripten: Failed to asynchronously prepare wasm: memory import has larger maximum

Created on 23 Mar 2017  路  2Comments  路  Source: emscripten-core/emscripten

I have compiled my wasm with the incoming branch and I have not set TOTAL_MEMORY (so the default is 16MB, I guess).

Loading my wasm works nicely in Chrome and Firefox. However, for large programs I get the familiar "Cannot enlarge memory arrays." error message. With Javascript, I fix this my adding total memory to my module:

var Module = {
    ...
    TOTAL_MEMORY: 200 * 1024 * 1024,

But when using wasm I get the following error message:

failed to asynchronously prepare wasm: LinkError: WebAssembly.instantiate(): memory import 47 has larger maximum than maximum 256, got 3200

So I cannot set Module.TOTAL_MEMORY when using wasm, even though the error message after "Cannot enlarge memory arrays." suggests that as an option.

wontfix

Most helpful comment

Yeah, thanks, in wasm the max memory size is baked into the wasm binary. We should improve the error message there, I opened #5073

All 2 comments

Yeah, thanks, in wasm the max memory size is baked into the wasm binary. We should improve the error message there, I opened #5073

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jcfr picture jcfr  路  4Comments

kripken picture kripken  路  4Comments

rpellerin picture rpellerin  路  3Comments

surma picture surma  路  4Comments

ShawZG picture ShawZG  路  4Comments