Skip to content
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

Fix memory problems with webpack-dev-server in development mode #2433

Merged
merged 1 commit into from
Jun 29, 2016

Conversation

bernd
Copy link
Member

@bernd bernd commented Jun 29, 2016

I am frequently running into webpack-dev-server memory problems in my development setup. Either my machine starts swapping or the node process dies with an out of memory error.

After some research I found a similar problem report in the webpack issue tracker. The problem is that our current dev setup uses hashes in filenames which means that on every change new files are built by webpack and served from memory. Since there is no mechanism to delete old ones, all files stay in memory and memory gets full eventually.

You can see this when you look at http://localhost:8080/webpack-dev-server. On every change to the javascript code, new files are appearing. In my case 104 files have been added on every change.

This change disables the usage of hashes in file names when running the webpack-dev-server in development mode. I have been running with this for one day and didn't run into any issues yet.

Before this webpack was using hashes in filenames for the generated
files which are stored in memory. That meant on every change new files
have been generated and stored in memory, quickly filling up the
available memory.

With this change we do not use hashes for filenames in development mode
to avoid filling up memory.
@bernd bernd added this to the 2.1.0 milestone Jun 29, 2016
@joschi joschi self-assigned this Jun 29, 2016
@joschi
Copy link
Contributor

joschi commented Jun 29, 2016

LGTM. 👍

@joschi joschi merged commit 3ab5918 into master Jun 29, 2016
@joschi joschi deleted the fix-dev-server-memleak branch June 29, 2016 13:47
joschi pushed a commit that referenced this pull request Jun 29, 2016
Before this webpack was using hashes in filenames for the generated
files which are stored in memory. That meant on every change new files
have been generated and stored in memory, quickly filling up the
available memory.

With this change we do not use hashes for filenames in development mode
to avoid filling up memory.

Refs webpack/webpack#1914
(cherry picked from commit 3ab5918)
bernd added a commit that referenced this pull request Sep 27, 2022
This resource was missed during the metrics history removal in #2433.

Refs #2433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants