Skip to content
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

Closed
poland-can-into-space opened this issue Jun 20, 2018 · 4 comments
Closed

Potential Memory Leak with New Date #21427

poland-can-into-space opened this issue Jun 20, 2018 · 4 comments
Labels
invalid Issues and PRs that are invalid. memory Issues and PRs related to the memory management or memory footprint.

Comments

@poland-can-into-space
Copy link

poland-can-into-space commented Jun 20, 2018

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!

@ChALkeR
Copy link
Member

ChALkeR commented Jun 20, 2018

Can't reproduce.

Using node-v8.11.3-linux-x64 with

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?

@ChALkeR ChALkeR added the memory Issues and PRs related to the memory management or memory footprint. label Jun 21, 2018
@killagu
Copy link
Contributor

killagu commented Jun 21, 2018

Can not reproduce with v10.5.0-darwin too.

@poland-can-into-space
Copy link
Author

It seems the memory leak was happening in conjunction with other parts of my code
I haven't been able to figured out exactly how it is happening.

I will come back once I figure it out.

Thank you for your time.

@bnoordhuis
Copy link
Member

I'll close this out for now then.

@bnoordhuis bnoordhuis added the invalid Issues and PRs that are invalid. label Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid. memory Issues and PRs related to the memory management or memory footprint.
Projects
None yet
Development

No branches or pull requests

4 participants