videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.78k stars 7.43k forks source link

memleak on live m3u8 when not start playing #5973

Open 0caspy opened 5 years ago

0caspy commented 5 years ago

Description

If open player with live m3u8, but not press start/play, memory will leak not releasing constantly refreshing m3u8.

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. create player with live HLS stream.
  2. open it, but NOT press play
  3. wait and look for memory

Results

Expected

Constant memory usage

Actual

Memory usage increase in 'heap snapshot' (chrome) i see strings objects with m3u8 content. but outdated content not released, thus adding new string with refreshed m3u8 content every 'target duration' seconds. as soon as you press 'play', no more string will be leaking. an outdated objects will be released on each m3u8 update.

Error output

no errors

Additional Information

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

versions

videojs

7.5.4

browsers

Crome. may be others too.

OSes

MacOS Mojave in my case

plugins

no plugins

0caspy commented 5 years ago

if put video on pause - the same story. memory not released upon m3u8 update

gkatsev commented 5 years ago

Hey, can you show us where in the heap snapshot you were finding the m3u8s? Would make it easier for us to track it down and make sure we're on the same page.

gkatsev commented 5 years ago

I looked at it a bit yesterday and I have one simple fix (https://github.com/videojs/http-streaming/pull/487), there's definitely a lot more we need to do.

0caspy commented 5 years ago

Hey, can you show us where in the heap snapshot you were finding the m3u8s? Would make it easier for us to track it down and make sure we're on the same page.

please, take a look on two screenshots. normal, while playing leaked, when not playing

gkatsev commented 5 years ago

Thanks! We're definitely going to schedule time to investigate the memory leaks.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

zsilbi commented 1 year ago

The source of this leak is in the m3u8 parser: https://github.com/videojs/m3u8-parser/issues/164