Skip to content
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

out of memory with emscripten modules #529

Open
matthewbauer opened this issue Jan 26, 2016 · 3 comments
Open

out of memory with emscripten modules #529

matthewbauer opened this issue Jan 26, 2016 · 3 comments

Comments

@matthewbauer
Copy link

I just want to document this because I don't see it anywhere. Probably not possible to fix because of the nature of emscripten. Here is the output of nyc but I think the issue stems from the way istanbul is doing things:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

<--- Last few GCs --->

   16041 ms: Mark-sweep 1390.4 (1457.1) -> 1397.3 (1457.1) MB, 1006.1 / 0 ms [allocation failure] [GC in old space requested].
   17008 ms: Mark-sweep 1397.3 (1457.1) -> 1397.3 (1457.1) MB, 966.7 / 0 ms [allocation failure] [GC in old space requested].
   17972 ms: Mark-sweep 1397.3 (1457.1) -> 1388.7 (1457.1) MB, 964.9 / 0 ms [last resort gc].
   19013 ms: Mark-sweep 1388.7 (1457.1) -> 1390.3 (1457.1) MB, 1040.3 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x63a4ff36ae1 <JS Object>
    2: apply [/Users/matthew/Projects/retrojs/node_modules/nyc/node_modules/istanbul/lib/instrumenter.js:~284] [pc=0x3e4644f34eb2] (this=0xbb43be089c1 <a Walker with map 0x1724a4618841>,node=0x3eca5fc7c6e1 <a Node with map 0x1724a4619b29>,walkFn=0xbb43becb0c9 <JS Function Instrumenter.coverStatement (SharedFunctionInfo 0xf2f4d0848d1)>,pathElement=0x63a4ff04131 <undefined>)
    3: arguments adapt...
@gotwarlost
Copy link
Owner

How big is this file? Given there are no streaming APIs for JS parse and code gen, istanbul has to rely on loading the whole file in memory and performing all the operations there.

Not sure if I can find a fix for this at all.

@matthewbauer
Copy link
Author

The emscripten output file is like 2.7M. Is that going to be too big for code coverage? I'll try using max-old-space-size flag to see if anything more comes up.

@pahund
Copy link

pahund commented May 5, 2017

@matthewbauer any luck in fixing this? I have the same issue when running my coverage build on Jenkins CI with nyc.

My tests are not related to emscripten, it's an Express web application.

I've tried using --max-old-space-size and --max-new-space-size. I also tried redirecting the console output to a file as this issue suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants