-
Notifications
You must be signed in to change notification settings - Fork 12k
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
build-optimizer: high memory usage (node crash) #12159
Comments
From @filipesilva on November 17, 2017 16:15 Hi @MrBlaise, does this happen on a project I could look at? In the context of #5618, I expect Build Optimizer usage to always use some memory, but It's odd that it happens at the 95% stage since most of the work Build Optimizer does is before the 90% phase. Regardless, in #5618 (comment) I also have a report of high memory usage that I can't really reproduce, and in #5618 (comment) I have a report of very long times for build optimizer. If your project isn't available, would you be interested in following some debug steps? |
From @MrBlaise on November 17, 2017 16:48 Hi @filipesilva ! Unfortunately I can't share the project because it is private but I am more than happy to help with the debugging steps If I can. |
From @filipesilva on November 17, 2017 16:58 That's great to hear! I think it can be one of two things: either a transform is taking up a lot of memory, or the purify plugin has a runaway regex. Lets measure how much memory some runs take. Make a new npm scrip that runs the CLI with increased memory allowance:
This number should be enough but increase it if you need to. If you're on a mac the easiest way to see peak memory usage is to use
The number you want is Then do the same with Testing purify is easiest. Go to I think one of the build optimizer transformations is using up a lot of memory on your codebase, but I can't know which ones. I can tell you how to disable each one individually though. You can do this in If you can do this for each one and time me how it impacts memory used, I might be able to figure out which of the transforms is using up a lot of memory. |
From @MrBlaise on November 17, 2017 18:54 Here are my tests @filipesilva . I don't know it it is helpful, I don't see much difference with all the options :/ Testing purify enabled or disabled:purify ENABLED purify ENABLED Testing build-optimizer transformations (
|
For what it's worth - I'm getting the same issue after I migrated from 5 -> 7
|
This one allowed me to get past the build - #12645 (comment) but there are other problems... I'll report them separately. |
@chadbr the out of memory issue when updating to 7.0 is reported and investigated in #12646. It has to do with more code being brought in. I don't think the original issue here is present anymore. It was originally from about a year ago and since then we have addressed a lot of the performance problems with build optimizer. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
From @MrBlaise on October 26, 2017 12:8
Bug Report or Feature Request (mark with an
x
)Area
Versions
macOS 10.13 (High Sierra)
It affects Windows as well, but on mac it is higher (larger than 1.7 gigs, therefore causes crash with node by default)
Repro steps
The problem is happening with the build-optimizer version
0.0.31
.Using @angular/cli
1.5.0-rc.2
and building withng build --prod --aot --build-optimizer
The memory usage starts to grow radically at
95% emitting
stage. On a semi-large project this reaches 1.7 gigs on mac, which in turn causes a crash. Increasing the memory limit on node solves the issue, but this seems rather high.Running it without build-optimizer it builds fine without a crash.
The log given by the failure
Desired functionality
Using the build-optimizer shouldn't exceed the default 1.7GB threshold on a semi-large project.
Copied from original issue: angular/devkit#240
The text was updated successfully, but these errors were encountered: