-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasm: memory usage #25975
Comments
We currently have to request a large amount of initial memory, because requesting more memory later is a relatively slow operation. Most of the memory is never used, so the WebAssembly runtime and/or the operating system should be able to not actually allocate physical memory for it. We will probably revise this in the future. |
Looks like there is nothing much to be done here. Closing it. Feel free to comment if you disagree. |
I recently had to turn this value down and recompile Go when trying to fit a Go compiled WASM into a Cloudflare Worker, since it only allows you to request 2048 pages of memory: Of course, even after I got past that error my worker immediately tried to allocate too much memory and crashed... but there are use cases for low-memory WASM modules. |
We will definitely address this as soon as WebAssembly has the necessary features. |
This may be fixed/better with #27462 |
I was monitoring the memory usage (using Safari developer tools) on an empty wasm program:
with the example here https://github.com/golang/go/tree/master/misc/wasm
When the page loads, the memory usage is 1.01GB. When I click on
run
the memory usage becomes 3.01GBbut on Google Chrome the memory usage is 17.5MB / 25.6MB (clicking on run has no memory effect)
Is this a browser compatibility issue?
cc @neelance
The text was updated successfully, but these errors were encountered: