Skip to content

Bug: Mux Player memory not released when unmounted #1235

@musatov

Description

@musatov

Is there an existing issue for this?

  • I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-player-react

Which browsers are you using?

Chrome

Which operating systems are you using?

macOS

Description

<mux-video> and <mux-player> elements are not released from javascript heap when the React MuxPlayer component is unmounted.

Reduced test case

https://github.com/musatov/mux-video-memoryleak

Steps to reproduce

  1. Open the home page with a couple of links to video's pages
  2. Open the dev tools and make s heap snapshot - make sure there is no mux-video nor mux-player objects in the heap
  3. Navigate to the single video page
  4. Navigate back to the home page
  5. Force garbage collection
  6. Make snapshot again
  7. There is mux-video and mux-player objects in the detached state in the heap.
memory-leak.mov

Current Behavior

The objects related to unmounted react MuxPlayer component are in the heap.

Image

Expected Behavior

<mux-video> and <mux-player> elements are cleaned up.

Errors

No response

What version of the package are you using?

3.8.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions