-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential Memory Leak with New Date #21427
Comments
Can't reproduce. Using setInterval(function() { console.log({ now: new Date }) }, 100); memory usage stays stable for me. Is there anything else I am missing? Can you reproduce the issue on a js file with that single line? |
Can not reproduce with v10.5.0-darwin too. |
It seems the memory leak was happening in conjunction with other parts of my code I will come back once I figure it out. Thank you for your time. |
I'll close this out for now then. |
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: