-
Notifications
You must be signed in to change notification settings - Fork 64
Node process runs out of memory #23
Comments
The project I am targeting is an Ahead of Time (AoT) compiled Angular 2.0 application |
Thanks for the bug report. We've tested the project on medium-sized builds but obviously did not go far enough. Can you post repro instructions? Do you have a branch I can check out and run build? |
@samthor Thanks for the quick response. Here are the repro steps
The second step will first run the Angular 2 Ahead-of-time compiler on the Angular source. Next the result of that is fed into rollup where the closure compiler will be triggered via the plugin. My observation has been that the process runs for a few minutes before the error occurs. |
I can confirm this issue happens in even a modest hello world example of Angular 2 compiled AOT. |
Are you giving more than the default heap? |
@concavelenz I am not 100% sure what you mean. I have tried setting
|
yes, what values did you try? On Sun, Sep 18, 2016 at 10:51 AM, Torgeir Helgevold <
|
I tried a few different values. I remember setting to 8000 and 14000 on a Mac with 16GB of Ram |
@samthor Same problem appeared, it would be great if you have a solution to make the large-sized js works ok. |
I'm getting the same problem.
|
Can you please try again with Node v8.3.0? We believe that this version lifted the maximum value supported in |
@samthor Thanks for your replay, but my real intention is that we have no much space for the closure compiler, and java version of closure compiler is ok. So I simply think that the final solution is that javascript version needs to be improved, not about the node version to lift the maximum value. |
I've also got the same issue when compiling 4.3 MiB file with Node v8.4.0.
stdout:
If mentioned reproducible example is not enough, I can prepare another one. Interestingly, this seems to happen after I've squeezed last compilation errors, it worked with incomplete externs with some complaints, but didn't crash. |
@nazar-pc can you confirm this is happening with a large e.g. |
@samthor, yes, |
What about higher—8192 etc? The Node team tell us that there should be "no limit" as of 7.3 or higher, so I'd be surprise if you couldn't get it to compile with a large number. (We're obviously not happy that so much memory is being used, but as a stop gap.) |
I was really generous, gave it 20000 MiB of memory (more than most people have in total). Node process peaked at 19.7 GiB, tried pretty hard for a few minutes, but eventually also crashed. |
Here is a demo project that can be used to reproduce an issue: https://github.com/nazar-pc/closure-compiler-js-bug-23 |
@samthor, is there anything else I can do to help getting this issue fixed (it is opened for almost a year now)? |
I'm having the same issue. Is there any way to set this via CLI directly when I call |
@mccambridge set what? Issue is not fixed and increasing memory limit doesn't help. |
@nazar-pc Gotcha. I thought I might be able to increase the limit. My project isn't huge, but it isn't small, either. |
I have the same issues. When compile just a simple js file it works. As soon as i include the Closure Library to it, it can't handle it :( Edit: Upping the max limit to 8gb didn't work too! |
Any progress on the ticket? I came across with this issue as well, and it's a pity it prevents using this great tool. |
Use the Java implementation instead, it is way more stable @AntonioRedondo |
I see same issue while running ng build on docker. 92% chunk asset optimization |
For large compilations, the Java version is definitely recommended. |
Is this issue fixed? What happens when you have the error with small compilation setups? Is |
Development is moving to https://github.com/google/closure-compiler-npm If you can provide a repo case for a smaller source set, I can take a look. |
I think it is not necessarily about size, there some other issue when it uses over 20 GiB of RAM and still fails to finish compiling while Java version uses orders of magnitude less memory. |
There very well may be - but I can't reproduce that. If you have a project or source set that demonstrates the problem, we can look. |
When I run
91% additional asset processing Fatal error in , line 0API fatal error handler returned after process out of memory#FailureMessage Object: 0x70000fd71980Illegal instruction: 4` |
I have been trying to integrate the JavaScript version of the Closure compiler with my application as a Rollup plugin.
The process works for simple projects, but I have observed that the process runs out of memory in bigger projects:
The process runs for a while, but crashes eventually with the error message:
Here is my rollup code that integrates the
"google-closure-compiler-js": "^20160828.0.1"
packageI think the Java version will work, but I would really like to get this working with the JS version since the setup is so much simpler.
The text was updated successfully, but these errors were encountered: