videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.45k stars 419 forks source link

Memory leak causes browser to crash #1395

Closed zsilbi closed 1 year ago

zsilbi commented 1 year ago

Hello!

We have a live event next week, almost everything is ready but we face a very serious issue with our live player. Could you please point me in the right direction how to clean these from the memory?

Description

We experience very high memory usage while watching live HLS streams from Mux with DVR.

Related: https://github.com/videojs/video.js/issues/5973 Same old issue: https://github.com/videojs/http-streaming/issues/687

After 30-40 minutes of watch time it reaches 2GB and Chrome crashes. What I see from memory snapshots, that there are lot of RAW m3u8 strings kept in the heap:

image

image

Sources

Mux.io live stream, 5 quality playlists

Steps to reproduce

  1. Use any Video.js version (tried with from 7.0.0)
  2. Watch a live stream from Mux.io long enough.
  3. Wait for the crash.

Results

Expected

I expect to happen that the older files are being deleted from memory.

Error output

If there are any errors in the console, from the player, or anywhere else please include them here:

Additional Information

Please include any additional information necessary here. Including the following:

videojs-http-streaming version / videojs version

Every version of Video.js I tried has the same exact issue.

Browsers

Chrome (haven't tried any other)

Platforms

Windows (haven't tried any other)

Other Plugins

Bare Video.js from CDN, tried non-vtt as well.

Other JavaScript

Nothing, just a <video> element in the body.

Thank you!

welcome[bot] commented 1 year ago

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

zsilbi commented 1 year ago

I found the leak, it's in the m3u8 parser itself and related to the Chromium string slicing issue. I'll open an issue there.

See: https://github.com/videojs/m3u8-parser/issues/164