shaka-player
shaka-player copied to clipboard
Memory leak on multi-period streams
Have you read the FAQ and checked for duplicate open issues? Yes
If the problem is related to FairPlay, have you read the tutorial?
Yes
What version of Shaka Player are you using?
4.2.x => 4.7.x
Can you reproduce the issue with our latest release version? Yes
Can you reproduce the issue with the latest code from main
?
Yes
Are you using the demo app or your own custom app? Demo app
If custom app, can you reproduce the issue using our demo app? Yes
What browser and OS are you using? chrome, windows
For embedded devices (smart TVs, etc.), what model and firmware version are you using?
What are the manifest and license server URIs?
https://d24rwxnt7vw9qb.cloudfront.net/v1/dash/e6d234965645b411ad572802b6c9d5a10799c9c1/All_Reference_Streams/4577dca5f8a44756875ab5cc913cd1f1/index.mpd
What configuration are you using? What is the output of player.getConfiguration()
?
Default
What did you do?
Play stream and take memory heap snapshots using chrome dev tools at different times
What did you expect to happen? Memory heap to be stable
What actually happened?
Memory heap grows consistently for multi-period streams. On mono-period streams, we dot not notice the same result.
Please find screenshots:
-
Heap snapshots to illustrate inscrease of memory consumption:
-
Snapshots comparison after 45 minutes
-
Details and allocation call stack (based on v4.5.x) of retained objects
Please note that all objects (Text, Element, NodeList ...) are allocated in the same place.
Duplicate of https://github.com/shaka-project/shaka-player/issues/6070
I'm not sure this is a duplicate of #6070 since #6070 memory issue is related to SegmentTimeline and the one described in this issue is more generally related to multi-periods, and noticeably since at least v 4.2.x.
Reopening.
@bbert Can you test if it still happens with 4.8.3? Thanks!
@avelad Have you tested on your side?
I still observe memory increase:
We solved a memory leak, but I didn't know if it had solved all your problems or not.
My asumption is that memory consumption should not constantly increase in any case. After a quick check, the issue still remains for SegmentTimeline based multi-period streams.
Do you want send a PR to fix it?
For the time being, I'm not enough aware of source code to try to fix it in the shot term.
It seems indeed that the initial reason of the identified memory leak has been fixed (as discussed in #6070), but here is a potential clue to identify the leak:
I have tested the stream in this issue with Cobalt browser with a simple html page and default shaka config. Using main branch (12 May, last commit 5f8628a4a). I can confirm growing memory usage. Also tested in Chromium (124.0.6367.155, Xubuntu 22.04) and see these JS heap size: 5 min : 12-16 MB 1 hour : 83-91 MB 2 hours : 174-179 MB 3 hours : 257-263 MB
PS. We have a similar problem with another dash live stream and I have a fix for it. However that fix doesn't solve this issue.
In version 4.10.6 we have introduced some improvements, can you validate if it is enough or do we need more improvements? Thanks!
Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen
in a comment.
Hi @avelad From my point of view and the quick test I've done, there is no real improvement.
we should reopen this.
Any updates on this? Would implementing a custom ABR solution help as an intermediate step?