Open JackCrispy opened 2 years ago
Any news updates on this?
you need to provide more information, like package, FFMPEG, Docker, NPM, NodeJS and others Env versions, total memory available etc...
I have Node-Media-Server process running for weeks without any memory leaks, unless you provide full context you should not expect any proper helps and feedback on your issues.
I have the same issue.
Create a VPS with 2GB ram (I tested on Debian 10 with Nodejs 14 and 16.13.0). Run service with the relay. Open the htop. (Check memory usage) Now, start stream for 5 sec then stop it. Do it several times like +10 times. Close the stream and check the memory usage once again! It will be using more than 40% memory after +200 connect/disconnect. (More connect/disconnect will take more memory) @hthetiot
I am also seeing memory leaks -- mem usage increases from about 20% to 80%+ over the course of a couple days
Can you try version node-media-server@2.1.8 see if that a leak that was introduced after this version @masterking32
Hi, Thank you for your response. I already tested the last version and version 2.1.9. (I used this library for more than 1 year) Both have the same issue, But I think the last version has more memory issues. Lemme compare the changes from 2.1.8 to 2.1.9. If you want I can test it too.
Update: Ok, I checked versions 2.1.8 to 2.1.9, I think there is not an important update. (There is two commits, https://github.com/illuspas/Node-Media-Server/commit/9eaa2c83075b2530168dbf2484be9cdfe5dbfeac and https://github.com/illuspas/Node-Media-Server/commit/dce482e8c1ae579d33d4623b20002283f364f3f0 ) But, The issue existed on 2.1.9, But I think, There is more memory leak in version 2.3.8. @hthetiot
I'm not really sure how NMS is calculating memory usage, but on my 2 core Ubuntu VPS, htop shows 25% memory usage, while NMS is claiming ~70%. So although your app has crashed, I'm not sure their memory consumption graph is accurate.
I'm not really sure how NMS is calculating memory usage, but on my 2 core Ubuntu VPS, htop shows 25% memory usage, while NMS is claiming ~70%. So although your app has crashed, I'm not sure their memory consumption graph is accurate.
How about ffmpeg, can you see memory usage from it? Can.you guys also share your FFMPEG version. I use ffmpeg 4.2.2 on my instance.
I'm not really sure how NMS is calculating memory usage, but on my 2 core Ubuntu VPS, htop shows 25% memory usage, while NMS is claiming ~70%. So although your app has crashed, I'm not sure their memory consumption graph is accurate.
How about ffmpeg, can you see memory usage from it? Can.you guys also share your FFMPEG version. I use ffmpeg 4.2.2 on my instance.
4.1.6,4.2.4, 3.4.9, I tested those versions.
Turning off the option rtmp.gop_cache can ameliorate this problem.
Turning off the option rtmp.gop_cache can ameliorate this problem.
I did that before.
I'm running in a docker container and installing the latest version of ffmpeg. Can't easily see the memory usage of ffmpeg -- I'm not even sure ffmpeg is running at all when the app is idling with no streams. Currently, NMS admin is claiming a 95% memory usage, but htop is saying only about 30%
3 years later and version 2.6.6 sill has the same issue. Any updates here?
left it running for some hours, heap kept increasing,
each time I refresh, there is a new connection to the server and each of the connections is taking up a few % of memory to handle on computer.