News for hackers. Stuff that matters.
Re:JavaScript and Node performance coding tips to make appli... by aetherspawn on Tuesday March 13, 2018 @06:24AM (#16574941)
I think this is true because they hold a reference in window.
Re:JavaScript and Node performance coding tips to make appli... by mulrian on Tuesday March 13, 2018 @06:35AM (#16575011)
Sure that will prevent gc, but that doesn't mean it's a memory leak
Re:JavaScript and Node performance coding tips to make appli... by dspillett on Tuesday March 13, 2018 @07:45AM (#16575324)
It is if the variable is accidentally in global scope due to hoisting if it is not explicitly defined in a finer scope. Not an issue in strict mode, you'll get a reference error instead of an implied global.
Re:JavaScript and Node performance coding tips to make appli... by rootlocus on Tuesday March 13, 2018 @07:24AM (#16575248)
If you're never going to use it again, and you're never going to free it, it's a memory leak.
Re:JavaScript and Node performance coding tips to make appli... by Sawamara on Tuesday March 13, 2018 @09:35AM (#16575944)
No, it is not. A memory leak has to grow. Without the leak part, it is just ...allocated memory.