1

I have 500mb RAM limitation on render.com free plan, my webpack prod build takes up to 2gb RAM, so I'm unable to get successfull build there, as it goes above 500mb render.com kills the process and starts it over again.

I was able to reduce webpack build RAM usage to 560mb by disabling minification completely, sourcemaps generation.

What else can be done to reduce memory usage?

Rantiev
  • 2,121
  • 2
  • 32
  • 56
  • Does this answer your question: https://stackoverflow.com/questions/51536623/webpack-out-of-memory or this thread: https://github.com/webpack/webpack/issues/13550 – Harrison Jul 13 '23 at 13:51
  • No, one is about dev mode, which is totally different then running it on dedicated server with AOT build. The other is about multithredding which I have no access to. – Rantiev Jul 13 '23 at 13:55
  • Any reasons your not compiling locally and sending up your build files?. – Keith Jul 13 '23 at 14:09
  • Because remote updates are linked to git repo builds (I don't want to push builds to repo), and local builds copying seems more like old days manual FTP updates to me these days. – Rantiev Jul 13 '23 at 14:17
  • Yeah, FTP is a bit old hat. I use `SSH` and `unison` to get my builds sync, and then it's just a `unison mywebsite -auto` .. It certainly takes less memory. But back to webpack, have you excluded say `node_modules` from compiling?, eg. in your loaders have -> `exclude: /node_modules/,` otherwise webpack will compile these and that could take a fair bit of memory. – Keith Jul 13 '23 at 14:46

0 Answers0