-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Concurrent access, memory leak #857
Comments
It doesn't matter if the discovered flow name is different, I only push one flow and start three processes to pull the flow. Later, using a tool to pull 1000 concurrent flows, the generated memory is not released even after stopping the flow. It should be a leak caused by concurrency.
|
Must use tools to find: http://blog.csdn.net/win_lin/article/details/53503869
|
Note that SRS2 does not support VALGRIND, only SRS3 does. You can start by looking for it in SRS3.
|
OK! Currently using SRS3, VALGRIND calls.
|
Currently, no free memory has been found, but even after freeing it, the system does not reclaim it. Instead, the memory keeps increasing, which could be due to a memory leak in glibc's ptmalloc.
|
The following information appears on the playback end, but the streaming end does not.
|
The player is a cache for gop cache.
|
I have already cleaned up SrsSource and cleared the gop cache. The memory has indeed been increasing continuously.
|
I use v2 version, and this issue is easy to reproduce. Test steps:
Using the pprof tool to inspect: Note: I have a total of 1500 RTMP connections, suspecting it is related to memory allocation in ST (when is _st_stack_free called?), _st_stack_new about 1500 times. Each time there are 300 concurrent connections, _st_netfd_new about 300 times. Below are the results after stopping the stress test. (pprof) top
|
Ignore me, caused by compiling with the --with-gperf --with-gmc options.
|
The version number of the SRS being tested is 2.0.239.
Configuration File
Source configuration file origin.conf
Edge 1 configuration file edge1.conf
Edge 2 configuration file
Test Steps
Test Steps
3. Continuously pull changing streams from Edge 2 and the source end.
Results
The SRS version number is 2.0.239. When cleaning and closing the SrsSource, it was found that Edge 2's memory was increasing much faster than the source end. Later, after enabling the cleaning of SrsSource, it was observed that the memory of the source end and Edge 1 stopped increasing, while Edge 2's memory increased by 1M every half an hour. The memory did not decrease after stopping the stream. It remained constant.
It was confirmed that the pool size of Edge 2's SrsSource did not keep increasing and was eventually cleaned. Additionally, even after adding 803 to STATISTIC: Cleanup stream when closed #803, the memory leak issue remained the same. It seems that there might be other memory leaks in the stream pulling part of the edge.
Currently, there are no clear clues, so if anyone can help take a look, it would be greatly appreciated. Thank you~
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: