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

Projects
None yet
2 participants
@bernd
Member

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.

Fix memory problems with webpack-dev-server in development mode
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

This comment has been minimized.

Contributor

joschi commented Jun 29, 2016

LGTM. 👍

@joschi joschi merged commit 3ab5918 into master Jun 29, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1024 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 510 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@joschi joschi deleted the fix-dev-server-memleak branch Jun 29, 2016

joschi added a commit that referenced this pull request Jun 29, 2016

Fix memory problems with webpack-dev-server in dev mode (#2433)
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment