-
Notifications
You must be signed in to change notification settings - Fork 444
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
High Memory Consumption Issue #1245
Comments
What sort of memory consumption is involved? Are you using any video encoding? |
I am using VP8 for video and PCMU for audio. Actually I am setting up a basic SFU server. I have a group and separate PeerConnection for each users. I get their RTP packets and broadcast it to other members of the group using OnRtpPacketReceived. |
I think memory gradually increases in the receiving part. I removed the broadcasting code and ran the application, the memory still increased. Are the receiving RTP packets/frames stored locally in any buffer? |
I can't replicate this with RTP framing and depacketizer each do copies in their process but they look to be garbage collected correctly. |
I have this code in the SFU part
This is what happens when I start receiving RTPPackets from an user. memoryConsumption.mp4One time I even removed the SendRTP line and executed the code (only received packets, didn't forward)
But still the memory increased. I am currently checking Sipsorcery library for the memory consumption cause. This where the OnRtpPacketReceivedByIndex happens, right? Or do I have to check SipsorceryMedia.FFMpeg? Few minutes after the PeerConnection was closed, memory is cleared. But is it normal to have memory consumption while receiving RTPPackets? |
Yes, particularly with video streams. There are a lot of buffer copies required which all add up. |
Is it possible to clear the used copies? |
PR's welcome. |
Sure, I’m happy to work on this. Do you have any idea which files might be causing this issue? I am currently checking OnReceiveRTPPacket(). |
@imtadashi If no memory is released, then do snapshots in Visual Studio to find out who is hanging on to that memory. Hope this helps |
GC.Collect() works, but it consumes more CPU. Maybe using it with interval may reduce the memory consumption and maintain the CPU usage. |
sorry for butting in, Forcing Garbage Collection is discouraged, via MSDN,
Since I can't reproduce this, you can try to make the barest reproducible method for your case and use the Memory Profiling to find which part of |
Hi Sipsorcery team, I have been using Sipsorcery for few weeks and found memory consumption increases gradually. Is this normal? Even after stopping a PeerConnection, this memory is not disposed. Is there a way to forcefully dispose memory consumed by a PeerConnection or VideoStream?
The text was updated successfully, but these errors were encountered: