-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
failed to compile wasm module: RangeError: WebAssembly.Instance(): Out of memory: wasm memory #4916
Comments
Try giving Node.js more memory. |
I have tried adding 16000 and 32000 but still the same error. Because it is erroring on the yarn install I added it as an env var in the Dockerfile like so:
On one of the attempts I did get a new stack trace, but wasn't able to reproduce it with these memory settings again:
|
Huh, that's really strange, that shouldn't be nearly enough packages to trigger an OOM with that much RAM being given. |
We were hitting this error in the same call stack, and a few others. Turned out that our CI machine had 32-bit |
That would make sense. Except I am trying to do 32bit builds to switching to 64bit isn't an option for me. |
@Maggie0002 what are you trying to build that requires 32 bit system? |
For IoT hardware. |
@Maggie0002 is cross-compiling not feasible? Can you install on a 64-bit machine (Docker?) then copy over or something like that? (IoT and native code are not areas I have a lot of experience with, pardon my ignorance) |
Same issue on 64bit. Tried it locally on my M2 Mac, and on a Github runner, amd64 Ubuntu. Seems to be related to all armv7:
|
Maybe related: #3972 32bit but windows in that issue |
Did you find a solution? I am running into the same and use the x64 version. |
If you need a quick and dirty workaround, reducing the ZipOpenFS maxOpenFiles by editing the yarn .cjs worked for me: #3972 (comment) |
Self-service
Describe the bug
I am seeing failures when running yarn install on 3.2.2 (it continues on for many more packages, but chosen the below just as examples:
failed to compile wasm module: RangeError: WebAssembly.Instance(): Out of memory: wasm memory
It occurs only when doing builds on a balena Cloud builder which uses Docker to build images, and only when using ARMv8 Docker images (all x64 and arm64 work fine) (node:18.9.1-alpine3.16, but tried others back to 14). There is plenty of memory available (even more available on the ARMv8 builders than the x64 and arm64). When I do the same
yarn install
on a ARMv8 device directly it works ok, it seems to be only related to Docker buildx builds.This is a really difficult one to provide a means for people to reproduce and debug, so logging instead here an issue to see if anyone might have any ideas on what to explore, or thoughts that come to mind on why this is failing. Here is the repo using to test which generates the issue: https://github.com/maggie0002/yarn-test
I have been reading a lot about the ZipFS and memory allocation, I am wondering if that could be related? This issue doesn't occur on Yarn 2 or Yarn classic, but does occur on all Yarn 3 including latest.
To reproduce
Not really reproducible without registering with balena and using the cloud builders. Here is the repo being pushed though: https://github.com/maggie0002/yarn-test
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: