-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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 growth issue about crypto module. #13917
Comments
Define 'memory growth'? How and what do you measure? |
@bnoordhuis I mean memory leak. I just run that code and the result was like attached picture. |
Okay, but what is 'Memory used'? RSS, JS heap, something else? It's not unexpected that the memory footprint grows over time because the garbage collector periodically resizes the heap. As long as you don't get actual out-of-memory errors, there probably is no memory leak. |
@bnoordhuis I took memwatch result of heap diff and rss. I executed 5,000,000 times in a loop. If this is not a memory leak, why memory usage is growing? My test approach was wrong?
...
|
Now we're getting somewhere. So it's RSS that steadily grows while the JS heap only grows in fits. At what interval did you record those samples? Since you are on Linux, can you check if your issue is #11077? In a nutshell: disable transparent huge pages if they are enabled. |
I recorded every 200,000 executions. I will check the link you mentioned. @bnoordhuis Already turned off. |
RSS is only increasing when I called |
Thanks, I was able to reproduce, I'll look into it. |
Fix a memory leak by removing the heap allocation altogether. Fixes: nodejs#13917
Do we know if this is a regression, and if so, when it was introduced? |
Not a regression, AFAICT. It's been present ever since authenticated mode support was added in commit e0d31ea from November 2013. |
Fix a memory leak by removing the heap allocation altogether. Fixes: #13917 PR-URL: #14122 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Fix a memory leak by removing the heap allocation altogether. Fixes: #13917 PR-URL: #14122 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
@bnoordhuis how can this be prevented? |
If I run cipher related function many times, I can see memory growth even though execute gc manually.
To be more specific, if I use cipher.final(), it causes memory growth.
Below is test code.
The text was updated successfully, but these errors were encountered: