Hacker News new | ask | show | jobs
by glasser 4732 days ago
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.
1 comments

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.