Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳 nice! Wild to think that the magic of
[name].js
is the fix here. Can you unpack and explain that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bfeister previously, our webpack build a single file
server-renderer.js
for SSR and this file is huge because it includes all dependencies and that file is about 50MB. Each time a change happens, webpack re-build this 50MB file and saves it in memory.While we can't completely eliminate the memory leaks because it happens in 3rd party modules like
global._
,global['__core-js-shared__']
, and there is also the bug in Node internal that actually holds on to references for dynamic imports. It's nearly impossible to eliminate the issue, but we can mitigate the issue by splitting the build into very small chunks, so each build would be much smaller, thus take less space in memory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing! I tested this PR on my local, not running into this issue once. Great job on finding the solution