Skip to content

Comment on A surprising JavaScript memory leak found at Meteorparent

Comments

To be clear: when you say "removing the call to doSomethingWithStr() doesn't change the unbounded memory growth" you do literally mean "removing the call" and not "removing the function definition", right? That matches what I see.

Correct. I'm actually a little surprised that an identity statement like "str;" isn't optimized out.

Edit: removing the function definition eliminates the problem, so I'd say that your diagnosis of the problem is spot on.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.