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

webpack not freeing RAM after bundling #95

Closed
meaku opened this issue Jul 26, 2013 · 3 comments
Closed

webpack not freeing RAM after bundling #95

meaku opened this issue Jul 26, 2013 · 3 comments

Comments

@meaku
Copy link

meaku commented Jul 26, 2013

We experienced that webpack keeps the RAM it needed for bundling, even if the bundling finished. This means our server process has about 300 MB resident mem usage at the moment.

We created the bundle and spinned up the server in the same process.

Is webpack already using a separate process for the bundle process?
Is webpack holding references after bundling?

Maybe it's just the wrong setup on our side...
It would be nice to solve this problem anytime soon, because we are running out of memory ;)

@sokra
Copy link
Member

sokra commented Jul 28, 2013

If you have any reference to the Stats object, it will not be able to garbage collect all bundling stuff. (peerigon/alamid/blob/master/lib/core/bundle/Bundler.class.js#L25, call .toJSON() to convert it to a JSON object without references)

If you have enabled caching, it will not garbage collect the cache as long as you have a reference to the Compiler object.

webpack doesn't use a separate process.

It's not good to bundle in the same process as the server. Bundling is more a preparation step. You should separate the two steps (in production).

@meaku
Copy link
Author

meaku commented Jul 31, 2013

Thanks for your help :)

I tried calling toJson but it didn't work.
Although i did not find any references to the compiler in our application-logic.

Your suggestions of separate processes was on our todo-list anyway so i implemented it this way.
The bundle process was only part of the server to ease deployment during development.
We will use a separate bundle process for production anyway :)

Thanks!

@meaku meaku closed this as completed Jul 31, 2013
@sokra
Copy link
Member

sokra commented Aug 3, 2013

The filesystem cache holds its content for a minute. Maybe thats the origin of the memory.

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

No branches or pull requests

2 participants