You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live HLS: fragment objects accumulate for the whole session, and the per-second loops walk every hole #211
Where:chrome/player/players/hls/HLSPlayer.mjs (trackUpdated: if (!this.client.getFragment(identifier, fragment.sn)) makeFragment(...); nothing deletes entries whose sn has left the live window), chrome/player/FastStreamClient.mjs (freeFragments drops only the data of complete fragments; the store is a sparse array indexed by media sequence number, and for (let i = 0; i < fragments.length; i++) loops run every second)
What happens
A stream watched for hours keeps one HLSFragment plus the hls.js Fragment (stats, elementary-stream info, key references) per segment ever listed: about 1-2 KB x 1,800 per hour for 2 s segments, and the per-second loops grow linearly; a 24 h session is tens of MB and millions of empty iterations per tick.
Suggested fix
In trackUpdated, after walking levelDetails.fragments, delete store entries with sn < levelDetails.fragments[0].sn - keepBehind (calling freeFragment first), or switch the per-level store to a Map keyed by sn and iterate its values.
Confidence: high on the growth; medium on practical impact.
From a line-by-line code review of the tree at 41363fd (2026-10-02). Each claim above was checked against the source before filing; the reproduction steps and line references are as of that commit.
Activity
fix(hls): a live stream's fragments are stored from its first segment…