You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been experiencing a terrible memory leak for a while.
After digging my code, I'm convinced that new Date was the cause of the leak.
Here is my code; setInterval(function() { console.log({ now: new Date }) }, 100);
And after I changed it to setInterval(funciont () { let info = { now: new Date }; console.log(info); info = null; }, 100);
The memory usage has significantly decreased.
I should also note that when I changed new Date to Date.now() I experienced the same memory usage decrease.
Thank you for your reading my post!
The text was updated successfully, but these errors were encountered:
I have been experiencing a terrible memory leak for a while.
After digging my code, I'm convinced that new Date was the cause of the leak.
Here is my code;
setInterval(function() { console.log({ now: new Date }) }, 100);
And after I changed it to
setInterval(funciont () { let info = { now: new Date }; console.log(info); info = null; }, 100);
The memory usage has significantly decreased.
I should also note that when I changed new Date to Date.now() I experienced the same memory usage decrease.
Thank you for your reading my post!
The text was updated successfully, but these errors were encountered: