question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Higher stable memory usage in Webpack 5 on cold start

See original GitHub issue

Bug report

What is the current behavior?

https://github.com/JoshuaKGoldberg/webpack-5-memory-repro

I set up ☝️ reproduction repository to show a surprising behavior with Webpack 5 compared to Webpack 4: although the peak memory usage is improved on cold start, the stable amount is an extra 50%+ higher.

Webpack 4 memory usage grows towards a peak, then down to a stable amount:

Run Stable Peak
1 1.04 GB 2.49 GB
2 1.08 GB 2.29 GB
3 1.07 GB 2.37 GB

Webpack 5 memory usage remains stable at roughly its peak:

Run Stable
1 1.65 GB
2 471 MB
3 471 MB

Is there a memory leak on cold start?

If the current behavior is a bug, please provide the steps to reproduce.

See README.md steps in that repo.

What is the expected behavior?

After whatever cold start logic runs, it should go down to 471 MB.

Sorry if this isn’t the right repository to post this issue; I wasn’t sure given the tool dependencies…

Other relevant information: webpack version: 5.23.0, comparing to 4.44.1 Node.js version: 12.16.0 Operating System: macOS Additional tools: webpack-dev-server: 3.11.2, comparing to 3.9.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

0reactions
JoshuaKGoldbergcommented, Nov 13, 2021

Ah, yeah, I’d hoped to send details privately but it’s looking like this isn’t something we have time to make progress on. Internally we’re moving to Next.js microfrontends instead, each of which have Webpack 5 running quite nicely.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 5 uses dramatically more memory than Webpack 4
I observed that webpack 5 uses nearly 4 GB of memory on this benchmark, while webpack 4 used just 500 to 800 MB....
Read more >
Keep webpack Fast: A Field Guide for Better Build Performance
Use records to stabilize module IDs​​ webpack assigns an ID to every module in your dependency tree. As new modules are added and...
Read more >
How We Reduced Startup Time by 80% With Webpack
Specifically, we saw Out Of Memory errors and increased CPU utilization during the server startup. While it is not a bad practice to...
Read more >
This is all you need to know about Lambda cold starts
A “cold start” is the 1st request that a new Lambda worker handles. ... would you that you should use a higher memory...
Read more >
Webpack: How to fix "Heap out of memory - m4x
Webpack memory consumption depends on the size of your project. If you run into issues try throwing a little bit of money at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found