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

Fix theoretical memory leak on reload in stream PlaybackObserver creation code #1286

Merged
merged 1 commit into from Sep 26, 2023

Conversation

peaBerberian
Copy link
Collaborator

When working on the WebWorker branch (#1272), I noticed a (small) memory leak where a created PlaybackObserver could still be running after a reload for the same content, whereas it should not.

This removes that leak by ensuring all logic is cleaned-up on each reload.

However, we do have memory-leak tests checking for leaks in that area and it didn't find anything, running the corresponding test before and after the commit is applied seems to result in roughly the same JS heap size. We may have to look if the test does not do what we want it to do or if the leak in question is very insignificant/does not apply in our current code.

@@ -445,13 +445,14 @@ export default class MediaSourceContentInitializer extends ContentInitializer {
}
}, { clearSignal: cancelSignal, emitCurrentValue: true });

const streamObserver = createStreamPlaybackObserver(manifest,
playbackObserver,
const streamObserver = createStreamPlaybackObserver(playbackObserver,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: I also changed a little that function's parameters which mixes objects and values without a very clear reason.

…tion code

When working on the WebWorker branch (#1272), I noticed a (small) memory leak
where a created PlaybackObserver could still be running after a reload
for the same content, whereas it should not.

This removes that leak by ensuring all logic is cleaned-up on each
reload.

However, we do have memory-leak tests checking for leaks in that area
and it didn't find anything, running the corresponding test before and after
the commit is applied seems to result in roughly the same JS heap size.
We may have to look if the test does not do what we want it to do or if the
leak in question is very insignifance/does not apply in our current code.
@peaBerberian peaBerberian force-pushed the fix/stream-playback-observer-memory-leak branch from b3f3a1b to 52890df Compare September 25, 2023 17:06
@peaBerberian peaBerberian added this to the 3.32.0 milestone Sep 25, 2023
@peaBerberian peaBerberian merged commit 897f514 into master Sep 26, 2023
3 checks passed
@peaBerberian peaBerberian mentioned this pull request Oct 2, 2023
@peaBerberian peaBerberian deleted the fix/stream-playback-observer-memory-leak branch February 7, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant