Skip to content

Fix closure memory leak in Bundle constructor - #1470

Merged
Rich-Harris merged 1 commit into
rollup:masterfrom
dmitrage:closure-memory-leak
Jul 9, 2017
Merged

Fix closure memory leak in Bundle constructor#1470
Rich-Harris merged 1 commit into
rollup:masterfrom
dmitrage:closure-memory-leak

Conversation

@dmitrage

@dmitrage dmitrage commented Jul 1, 2017

Copy link
Copy Markdown
Contributor

Should fix #883

"options" argument is captured by closures in Bundle constructor, so passing "cache" leads to chain of bundles in memory.

Similar bug is described here: https://blog.meteor.com/an-interesting-kind-of-javascript-memory-leak-8b47d2e7f156

I've created gist with test script, but don't known how to properly integrate it here.
https://gist.github.com/dmitrage/fff3d30280688356194c137323ea4e02

@Rich-Harris
Rich-Harris merged commit a06265c into rollup:master Jul 9, 2017
@Rich-Harris

Copy link
Copy Markdown
Contributor

tim-and-eric-mind-blown

You hero! Been scratching my head over this a while — thanks, this is incredibly useful. Have added your gist as a test.

@hugomrdias

Copy link
Copy Markdown

Thank you !!!!

spencer-brown pushed a commit to mixmaxhq/multibuild that referenced this pull request Jul 18, 2017
spencer-brown added a commit to mixmaxhq/multibuild that referenced this pull request Jul 18, 2017
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

Successfully merging this pull request may close these issues.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

3 participants