AssemblyScript / assemblyscript

A TypeScript-like language for WebAssembly.
https://www.assemblyscript.org
Apache License 2.0
16.82k stars 655 forks source link

How much memory? #2845

Closed 19Nazar closed 5 months ago

19Nazar commented 5 months ago

Question

Good afternoon, I have a question. I have a custom environment in webassemble that will provide such functions. https://github.com/19Nazar/WasmZig How much minimum memory will be required to run the assembly in python?

CountBleck commented 5 months ago

I'm confused. Is this a question pertaining to AssemblyScript, and not just WebAssembly?

HerrCai0907 commented 5 months ago

I'm confused. Is this a question pertaining to AssemblyScript, and not just WebAssembly?

Agree. The question is a little bit off-topic.

Back to the question, if "minimum memory will be required to run the assembly in python" means memory usage of wasm instead of the whole python program's memory. A good idea is to take a look memory section in *.wat file. And you can find the count of memory page (64k per page).

(memory $0 1)

Besides, memory.grow will increase the count of memory page during wasm running.

19Nazar commented 5 months ago

My mistake, in AssemblyScript. I'm just pre-calculating how much memory I need.