wasm-emscripten-finalize runs out of memory with -g option
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start in src/tools/wasm-emscripten-finalize.cpp around line 302 and inspect how EmscriptenGlueGenerator builds and writes the metadata string. Reproduce the large-project build with the -g option, then verify that finalization completes without excessive memory use and that the generated output remains correct.
Written by the indexing model from the issue text.
Description
I'm attempting to build a large project and debug it, but when building, the wasm-emscripten-finalize operation takes 18-20 Gigabytes of RAM to complete. In looking at the code, I would guess that this is due to the metadata being stored in a single string here:
https://github.com/WebAssembly/binaryen/blob/be02d3f0f2689475f31c4523010eed58f39d27cb/src/tools/wasm-emscripten-finalize.cpp#L302
seems like the EmscriptenGlueGenerator could be re-worked to stream that string as it's built so that it doesn't have to be saved in memory and then written out at the end.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 77
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/binaryen
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
WebAssembly/binaryen#9135 · 1 comment ·
-
Difficulty 2/5 Half a day Newbie friendliness 76/100
WebAssembly/binaryen#9018 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/binaryen#9133 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WebAssembly/binaryen#9123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/binaryen#9122 ·
All issues in WebAssembly/binaryen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
internal.h中,漏掉了1个定义。 Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
oxc-project/oxc#26944 ·