Increasing maximum WASM size?

WASM maximum size is very small, 100MiB.

  1. I wonder, why is it so small? Why not 4GiB?
  2. I am writing a package manager that will store WASMs. Therefore I need to know predictions of the future WASM max size. Is, for example storing 20 WASMs in heap memory a good idea? May it overflow on future size increase? How many WASMs can I safely store in heap memory?
  3. Is it possible that ever WASM(64) will be more than 4GiB? Is it likely?
1 Like

Hi! Randomly came across your question. Have you considered creating storage buckets for storing the WASMs? A design similar to what is used in CAP: GitHub - Psychedelic/cap: Open Internet Service to store transaction history for NFTs/Tokens on the Internet Computer - https://cap.ooo/

100MiB… I wonder, why is it so small? Why not 4GiB?

At the moment the Wasm binary must be validated, instrumented and compiled within round, i.e. within 1s. For large assets, there are asset canisters, stable memory, and other solutions.

How many WASMs can I safely store in heap memory?

It depends on size of each Wasm binary, right?

Is it possible that ever WASM(64) will be more than 4GiB? Is it likely?

The heap size for Wasm64 will be more than 4GiB for sure. The Wasm binary size might be increased with multi-round compilation.

2 Likes