-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storybook manager dev-server leaks memory during hot refresh. #13371
Comments
I think upgrading core's webpack-dev-middleware to the latest 4.x version may fix this issue, as their changelog mentions respecting the use of file hashes. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Just commenting to make not stale |
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-rc.5 containing PR #14264 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
That PR was reverted in #14283, so could we reopen for now? In the meantime, I'm working around this by overriding Storybook's webpack config to set |
Fixed in #14284 released in 6.2
|
Describe the bug
When using storybook in development mode, I've noticed that the amount of memory the node process uses increases with every change made to my react components. After doing some memory profiling, it appears to be that webpack-dev-middleware is writing to memory all of the data of the files made by storybook's temporary cache (located under
node_modules/.cache
after every hot reload, without clearing out previously made entries.Storybook is using a hash for its filenames in this cache instead of a static file name, causing webpack-dev-middleware to write the newly generated files' data to memory after each hot refresh. This should be changed to a static filename. See the following:
https://github.com/storybookjs/storybook/blob/next/lib/core/src/server/manager/manager-webpack.config.ts#L56
webpack/webpack#10796 (comment)
While the manager does have
writeToDisk: true
set, this does not prevent webpack-dev-middleware from writing to memory: https://github.com/webpack/webpack-dev-middleware#writetodiskTo Reproduce
node --inspect
.Expected behavior
The main process for running storybook in dev mode doesn't leak memory.
The text was updated successfully, but these errors were encountered: