-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Webpack 3 RC ModuleConcatenationPlugin crash, out of memory #5089
Comments
On a second run with Memory is quite limited on CI so going to play with how low we can get the memory until there's no crash for now. |
Probably for a separate issue but I actually see a slight increase (~1kb across vast majority of chunks) in our application using Wonder if there's an "off the top of head" reason why this may be? |
If you can isolate and reproduce the bundle size increase we'd be happy to look at it. However overall, the huge improvement should be seen through runtime execution decrease. |
I'm experiencing the same for a somewhat equal setup. Our build time goes up by 300% (I guess due to swap files) and the chunk size increases by 1kb for each split chunk. |
v8 gets slow when near the memory limit (GC runs very often). A increased build time for the It's also expected that the
That's maybe not wrong. Scope Hoisting doesn't decrease post-gzip size. pre-gzip size is usually a bit lower. pre-minimize size is ~ equal. You may get additional size savings while minimizing when the minimizer discovers some additional cross-module optimization, but that's rar. In this case post-gzip and pre-gzip size decrease. In some cases post-gzip size is bigger, because function names are longer (more functions in a single scope but only limited number of letters in the alphabet). |
Think i'm experiencing the same without the error logs. After the first bundle, with ModuleConcatenationPlugin, it does not recognize any changes anymore, so i have to restart it. |
For me it's bundling fine but the browser does't load the app giving error |
@aseem2625 then you should probably open another issue 😄 |
@aseem2625 look at this html-webpack-plugin comment, it fixed my 'undefined' error (mainly back to webpack@2.6.1) |
+1 |
My two cents: The project I've been testing ModuleConcatenationPlugin in, I've mostly gotten this on situations where I have cache enabled, e.g. on watch. I simply disabled it when I'm on HMR mode, for example, and only kept it when producing a final bundle, which is where the optimizations matter to me for the most part. |
@emilio-martinez As far as I rem., that's what is suggested by webpack's official medium post that |
@aseem2625 Yup, thanks, I realize that. I don't have it enabled with HMR, i.e., there are certain uses where I'm on "watch", no HMR, cache enabled for rebuilds, and I'm getting the error. |
Ran into this issue as well. If you wonder how to give webpack more memory through that flag:
|
Could you reproduce this issue on 3.5.2? It seems that #5471 is possibly related to this issue. |
@JLHwung Yes. I'm on 3.5.2 using Without ModuleConcatenationPlugin, the process maxes out around 2.5gb towards the end. Basically this means that we need to upgrade our CI boxes from 4gb to 8 or even 16. That expense is difficult to justify for the marginal gains from this plugin. Build speed isn't really an issue in a CI environment. I wonder if there could be a slower, disk-oriented version of the plugin that could run in the kind of low-memory environments common for CI? |
ModuleConcatenationPlugin memory problem was isolated in #5992 (comment) and fixed in #5997. |
Is this card still relevant? |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Webpack crashes trying to build our application when using
Webpack.optimize.ModuleConcatenationPlugin()
.Also note up until the crash the build time is also showing a >60% increase in regards to build time with this plugin.
If the current behavior is a bug, please provide the steps to reproduce.
Building a large application (3000-4000 modules), with several entry point, a few commons chunks, pretty aggressive code-splitting using
import()
everywhere and uglified with source-maps.What is the expected behavior?
No crash without having to bump memory usage. Note the build time increase is pretty significant too - wouldn't expect a single plugin to have such a drastic impact.
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
OS: Mac OSX
Node.JS: v6.9.1
Webpack version: 3.0.0-rc.2
Stack:
The text was updated successfully, but these errors were encountered: