Skip to content

emcc out of memory #1168

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

Closed
scriby opened this issue May 11, 2013 · 2 comments
Closed

emcc out of memory #1168

scriby opened this issue May 11, 2013 · 2 comments
Labels

Comments

@scriby
Copy link

scriby commented May 11, 2013

I'm trying to generate javascript for Pachi, and running into an out of memory error in the emcc node process. I'm wondering if it's possible to pass v8 arguments to the process to increase max heap size.

Steps to reproduce:

git clone git://repo.or.cz/pachi.git
cd pachi
git checkout pachi-10.00-satsugen

emmake make

mv pachi pachi.bc
emcc pachi.bc -o pachi.js

Relevant output:

Warning: warning: very large fixed-size structural type: [67108864 x i32] - can you reduce it? (compilation may be slow)
FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory
Traceback (most recent call last):
  File "/home/scriby/emscripten/emscripten.py", line 800, in <module>
    _main(environ=os.environ)
  File "/home/scriby/emscripten/emscripten.py", line 788, in _main
    temp_files.run_and_clean(lambda: main(
  File "/home/scriby/emscripten/tools/tempfiles.py", line 38, in run_and_clean
    return func()
  File "/home/scriby/emscripten/emscripten.py", line 796, in <lambda>
    DEBUG_CACHE=DEBUG_CACHE,
  File "/home/scriby/emscripten/emscripten.py", line 683, in main
    jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
  File "/home/scriby/emscripten/emscripten.py", line 176, in emscript
    assert '//FORWARDED_DATA:' in out, 'Did not receive forwarded data in pre output - process failed?
@kripken
Copy link
Member

kripken commented May 12, 2013

There is a v8 arg to increase the stack size, I think. But you should probably refactor the code to avoid that huge static allocation - that's 256MB! Compile with EMCC_DEBUG=1 and look in the .ll for where it is.

aheejin added a commit to aheejin/emscripten that referenced this issue Nov 29, 2017
After llvm-mirror/llvm@9f86840#diff-15ffc2fb5830c3a8c3c4c354857b1631, LLVM has two behaviors:
When executing llc with `-mattr=+nontrapping-fptoint`:
It generates nontrapping version of instructions, those with :sat
varient.

When executing llc with `-mattr=-nontrapping-fptoint`:
It generates trapping version of instructions, but it inserts
conditional checks around them so they don't trap and clamp to the
predefined value.

So it seems not very possible to support this trapping test including
three modes (allow, trap, and js) for wasm backend now.

Related: WebAssembly/binaryen/emscripten-core#1168, emscripten-core#5863
kripken pushed a commit that referenced this issue Nov 30, 2017
* Disable binaryen trap test on Wasm backend

After llvm-mirror/llvm@9f86840#diff-15ffc2fb5830c3a8c3c4c354857b1631, LLVM has two behaviors:
When executing llc with `-mattr=+nontrapping-fptoint`:
It generates nontrapping version of instructions, those with :sat
varient.

When executing llc with `-mattr=-nontrapping-fptoint`:
It generates trapping version of instructions, but it inserts
conditional checks around them so they don't trap and clamp to the
predefined value.

So it seems not very possible to support this trapping test including
three modes (allow, trap, and js) for wasm backend now.

Related: WebAssembly/binaryen/#1168, #5863
@stale
Copy link

stale bot commented Aug 31, 2019

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Aug 31, 2019
@stale stale bot closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants