Skip to content

Conversation

@tykus160
Copy link
Member

@tykus160 tykus160 commented Sep 9, 2025

TextEngine was storing closed captions and releasing them only on teardown. This might be a potential memory leak for long running sessions.
This PR addresses it by removing cached captions along with removed segments. Furthermore, it adds some more tweaks and improvements, such as:

  • simplify CEA cache structure, from Map<string, Map<string, Array<Cue>>> to Map<string, Array<Cue>>
  • adjust TextEngine buffered ranges with cached cues values

@tykus160 tykus160 added this to the V4.17 milestone Sep 9, 2025
@tykus160 tykus160 requested a review from a team September 9, 2025 08:12
@tykus160 tykus160 added type: performance A performance issue component: captions/subtitles The issue involves captions or subtitles priority: P1 Big impact or workaround impractical; resolve before feature release labels Sep 9, 2025
@shaka-bot
Copy link
Collaborator

Incremental code coverage: 83.33%

@tykus160 tykus160 merged commit f128e22 into shaka-project:main Sep 9, 2025
30 of 31 checks passed
@tykus160 tykus160 deleted the wt-cea-leak branch September 9, 2025 09:26
avelad pushed a commit that referenced this pull request Sep 9, 2025
TextEngine was storing closed captions and releasing them only on
teardown. This might be a potential memory leak for long running
sessions.
This PR addresses it by removing cached captions along with removed
segments. Furthermore, it adds some more tweaks and improvements, such
as:
- simplify CEA cache structure, from `Map<string, Map<string,
Array<Cue>>>` to `Map<string, Array<Cue>>`
- adjust TextEngine buffered ranges with cached cues values
avelad pushed a commit that referenced this pull request Sep 9, 2025
TextEngine was storing closed captions and releasing them only on
teardown. This might be a potential memory leak for long running
sessions.
This PR addresses it by removing cached captions along with removed
segments. Furthermore, it adds some more tweaks and improvements, such
as:
- simplify CEA cache structure, from `Map<string, Map<string,
Array<Cue>>>` to `Map<string, Array<Cue>>`
- adjust TextEngine buffered ranges with cached cues values
avelad pushed a commit that referenced this pull request Sep 22, 2025
This change will prevent removing every stored caption on seeking.

Issue is a regression introduced in #9068
avelad pushed a commit that referenced this pull request Sep 29, 2025
This change will prevent removing every stored caption on seeking.

Issue is a regression introduced in #9068
avelad pushed a commit that referenced this pull request Sep 29, 2025
This change will prevent removing every stored caption on seeking.

Issue is a regression introduced in #9068
avelad pushed a commit that referenced this pull request Nov 3, 2025
Steps to retroduce:
1. Load content with CEA captions
2. Enable subtitles
3. Disable subtitles
4. Wait for a few minutes - application will hang due to recursive
callbacks on text unload.

Issue is a regression introduced by combination of #7360 & #9068
avelad pushed a commit that referenced this pull request Nov 3, 2025
Steps to retroduce:
1. Load content with CEA captions
2. Enable subtitles
3. Disable subtitles
4. Wait for a few minutes - application will hang due to recursive
callbacks on text unload.

Issue is a regression introduced by combination of #7360 & #9068
avelad pushed a commit that referenced this pull request Nov 3, 2025
Steps to retroduce:
1. Load content with CEA captions
2. Enable subtitles
3. Disable subtitles
4. Wait for a few minutes - application will hang due to recursive
callbacks on text unload.

Issue is a regression introduced by combination of #7360 & #9068
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Nov 8, 2025
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Nov 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

component: captions/subtitles The issue involves captions or subtitles priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: performance A performance issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants