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

Memory Leak on v16.0.0-pre #38958

Closed
luhuaipei opened this issue Jun 7, 2021 · 14 comments
Closed

Memory Leak on v16.0.0-pre #38958

luhuaipei opened this issue Jun 7, 2021 · 14 comments
Labels
i18n-api Issues and PRs related to the i18n implementation. memory Issues and PRs related to the memory management or memory footprint. v8 engine Issues and PRs related to the V8 dependency.

Comments

@luhuaipei
Copy link

The pss/rss of the heap in /proc/pid/smaps will increase about 52k every time when I execute following code:
Please help to figure it out.

Thanks.

function newDate(){                                                              
    sysTime = new Date().toLocaleTimeString('en-US')                             
}                                                                                
                                                                                 
setInterval(newDate, 1000);   

And when I remove the parameter "en-US" of toLocaleTimeString, the program doesn't leak.

@bl-ue

This comment has been minimized.

@richardlau richardlau transferred this issue from nodejs/Release Jun 7, 2021
@Ayase-252
Copy link
Member

Does the issue happened on v16.3.0 or master(v17.0.0-pre)?

@luhuaipei
Copy link
Author

@Ayase-252 Hi

Here is the test result:
tag v14.17.0 NG
tag v15.14.0 NG
v16. 0. 0 OK
v16. 3. 0 OK

@Ayase-252
Copy link
Member

Here is the test result:
tag v14.17.0 NG
tag v15.14.0 NG
v16. 0. 0 OK
v16. 3. 0 OK

@luhuaipei
So... it looks fixed in v16. I suspect that #38178 fixed the issue since it is the only ICU-related change in v16.0.0 release and it will be release in v14.17.1 soon. You could try at that time.

@Ayase-252 Ayase-252 added i18n-api Issues and PRs related to the i18n implementation. v14.x labels Jun 8, 2021
@luhuaipei
Copy link
Author

@Ayase-252 Thanks. I cherry-picked the patch to my local, the issue still exists. Do you have other suggestions?

@Ayase-252
Copy link
Member

@luhuaipei Sorry, I don't have a clue now.

cc @nodejs/i18n-api

@luhuaipei
Copy link
Author

It seems the issue resides in v8. I use the d8 tool in V8(version 8.8.6) can reproduce this issue.

In d8 console, every time I execute

new Date().toLocaleTimeString('en-US')

The Rss section will increase by 52-56Kb.

@targos
Copy link
Member

targos commented Jun 9, 2021

@nodejs/v8

@targos targos added memory Issues and PRs related to the memory management or memory footprint. v8 engine Issues and PRs related to the V8 dependency. labels Jun 9, 2021
@luhuaipei
Copy link
Author

luhuaipei commented Jun 9, 2021

v8/v8@4b139f7

This patch indroduced the fix in v8 version(8.9.1)

@gengjiawen
Copy link
Member

v8/v8@4b139f7

This patch indroduced the fix in v8 version(8.9.1)

@gsathya Can you take a look ?

@gengjiawen
Copy link
Member

v8/v8@4b139f7
This patch indroduced the fix in v8 version(8.9.1)

@gsathya Can you take a look ?

cc @verwaest Is this you can help ?

@nikikalwar
Copy link

Hi All,
I took a look and it really exists, interested in working on it.
`let my_process=process;
function getTime(){
console.log(new Date().toLocaleTimeString('en-US'));
console.log(my_process.memoryUsage())
}

setInterval(getTime,2000)

`

@bl-ue
Copy link
Contributor

bl-ue commented Jun 17, 2021

@nikikalwar the best way to fix it would be to take a look at the commit v8/v8@4b139f7 and figure out just what in that commit started making it so slow.

@targos
Copy link
Member

targos commented May 3, 2023

Closing as v14.x is EoL.

@targos targos closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation. memory Issues and PRs related to the memory management or memory footprint. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

6 participants