-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
VTT cues are never cleaned up. Fix memory leak in live. #2309
VTT cues are never cleaned up. Fix memory leak in live. #2309
Conversation
…o the buffer offset and remove all cues before then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this kind of logic should reside in the ID3 controller as it is the one that manages the ID3 track, and you can see this by the fact that you had to reference the controller through the coreComponents
in a way which is non safe, as no one guarantees it will retain its index (7) in anyway.
I also think it is a bit "confusing" that we have a buffer-controller
but it handles only AV buffer and not all kinds of buffer, although I do believe the only other buffer we have is for text tracks(captions, subtitles and ID3), but the use cases for handling are so different that there's no point for mixing them probably.
I left the |
… and fire an event when the live_back_buffer_length is reached
Had a chance to look at how hls is communicating with events. |
It seems like the tests on master are currently breaking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this out on a live stream w/ many ID3 cues that I have access to, comparing against this branch and current master
. Both were using liveBackBufferLength
of 120
I verified that the ID3 cues are being removed properly 👍
Thoughts on getting this in soon, @johnBartos, @itsjamie, @OrenMe ?
Bump |
merging changes from video-dev#2309 and applying the CC fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@robwalch targeting this for 0.13.1 with the gap controller code.
Rob brought up a good point that I missed about the new event.
This PR will...
Implement flushing of the TextTrackCueList in accordance with the liveBackBufferLength config option, for live mode only.
This means that the id3 cues relevant to the current live buffer will still be maintained. However, we avoid the continuous growth that eventually consumes all the memory.
Why is this Pull Request needed?
VTT cues are not cleaned up until a stream is destroyed.
Long Live streams lead to a memory leak, as the TextTrackList continues growing with Cues until the browser runs out of memory and becomes un-responsive.
Are there any points in the code the reviewer needs to double check?
Resolves issues:
Checklist