Skip to content
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

Excessive memory usage for DASH live with EventStream nodes #7148

Closed
willdharris opened this issue Aug 9, 2024 · 1 comment · Fixed by #7285 or #7257
Closed

Excessive memory usage for DASH live with EventStream nodes #7148

willdharris opened this issue Aug 9, 2024 · 1 comment · Fixed by #7285 or #7257
Assignees
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly type: performance A performance issue
Milestone

Comments

@willdharris
Copy link
Contributor

Have you read the FAQ and checked for duplicate open issues?
Yes. These issues are related, but the fix added in v4.10.6 does not resolve this case.
#6070
#6610

If the problem is related to FairPlay, have you read the tutorial?

n/a

What version of Shaka Player are you using?

4.10.9

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?
custom

If custom app, can you reproduce the issue using our demo app?
yes

What browser and OS are you using?
Chrome Version 127.0.6533.100 (Official Build) (arm64)
macOS Ventura v13.6

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
n/a

What are the manifest and license server URIs?

Can provide private stream via email if needed.
Issue is not as pronounced but is reproducible with this public stream: https://refapp.hbbtv.org/videos/multiperiod_v8.php?drm=0&advert=1&emsg=0&video=v1,v2,v3&audiolang=eng,fin&sublang=eng,fin,swe&mup=2&spd=8.

What configuration are you using? What is the output of player.getConfiguration()?

Only change from default is manifest.dash.disableXlinkProcessing = true.

What did you do?

Load a Live DASH manifest with a 3hr DVR window (timeShiftBufferDepth="PT3H0M0S") that includes EventStream nodes in the manifest.

What did you expect to happen?
I expect to see JS Memory usage and GC more in line with earlier versions of Shaka.

What actually happened?

JS Memory grows at a much faster pace in v4.10.9 than in previous versions tested (v4.3.6 and v4.7.15).

Chrome Desktop - DASH LTS - JS Memory				
Time	v4.3.6	v4.7.15	v4.10.9	
30min	58MB	30MB	225MB	
60min	76MB	49MB	428MB	
90min	93MB	64MB	548MB	

task-manager-shaka-90min copy

Are you planning send a PR to fix it?
No. We can currently work around this issue by removing EvenStream nodes from our manifests and use InbandEventStream emsg instead. Note the memory improvements when EvenStream nodes are filtered from the manifest.

Chrome Desktop - DASH LTS - JS Memory - EventStream Filter				
Time	v4.3.6	v4.7.15	v4.10.9	v4.10.9 w/ Filter
30min	47MB	37MB	136MB	23MB
60min	58MB	52MB	258MB	39MB
eventstream-filter

Here is more detail on what may be contributing.

Our 3 hr DVR manifest includes 50+ EventStream nodes with combined thousands of child Event nodes.
In v4.10.9, Memory heap snapshots are showing thousands of Detached HTMLUnknownElements, which do not appear in v4.3 or v4.7.
detached-unknown-shaka-4 10 9

These elements appear to come from parseEventStream_ when elements are created with txmlNodeToDomElement.

parseeventstream-shaka

txmltodom-shaka

@willdharris willdharris added the type: bug Something isn't working correctly label Aug 9, 2024
@shaka-bot shaka-bot added this to the v4.11 milestone Aug 9, 2024
@joeyparrish joeyparrish added type: performance A performance issue priority: P1 Big impact or workaround impractical; resolve before feature release platform: Cast Issues affecting Cast devices labels Aug 9, 2024
@avelad avelad added component: DASH The issue involves the MPEG DASH manifest format and removed platform: Cast Issues affecting Cast devices labels Aug 22, 2024
avelad pushed a commit that referenced this issue Aug 23, 2024
Related to #7148 
Does not create parent elements anymore to reduce memory consumption.
Starts to use `createElementNS()` so created elements will keep proper
cases for tag names and they won't be anymore of type `HTMLElement`, but
`Element`, which should be more lightweight and suitable for our needs.
@Iragne
Copy link
Contributor

Iragne commented Aug 23, 2024

I'm working on a this too and I will share shortly my findings and possible pr. This look due also to a leaks I. Multi period manifest I'm still validating my findings

avelad pushed a commit that referenced this issue Aug 26, 2024
Related to #7148 
Does not create parent elements anymore to reduce memory consumption.
Starts to use `createElementNS()` so created elements will keep proper
cases for tag names and they won't be anymore of type `HTMLElement`, but
`Element`, which should be more lightweight and suitable for our needs.
avelad pushed a commit that referenced this issue Aug 26, 2024
Related to #7148 
Does not create parent elements anymore to reduce memory consumption.
Starts to use `createElementNS()` so created elements will keep proper
cases for tag names and they won't be anymore of type `HTMLElement`, but
`Element`, which should be more lightweight and suitable for our needs.
avelad pushed a commit that referenced this issue Aug 27, 2024
…7202)

Related to #6239 and
#7148
Remove the reference to the stream when is no more needed.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
JulianDomingo pushed a commit to JulianDomingo/shaka-player that referenced this issue Aug 28, 2024
…haka-project#7202)

Related to shaka-project#6239 and
shaka-project#7148
Remove the reference to the stream when is no more needed.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
avelad pushed a commit that referenced this issue Aug 29, 2024
…7202)

Related to #6239 and
#7148
Remove the reference to the stream when is no more needed.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
avelad pushed a commit that referenced this issue Aug 29, 2024
…7202)

Related to #6239 and
#7148
Remove the reference to the stream when is no more needed.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
@avelad avelad modified the milestones: v4.11, v4.12 Sep 12, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Nov 10, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly type: performance A performance issue
Projects
None yet
5 participants