New issue
Advanced search Search tips

Issue 804229 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Calling endOfStream before calling SourceBuffer.remove completes leaks memory

Project Member Reported by keishi@chromium.org, Jan 22 2018

Issue description

+wolenetz Is this a bug? It leaks memory on Firefox and Safari too so maybe not. But filing a bug just in case.

I found this test case
https://github.com/TasukuUno/sample-mse-memory-usage

It looks like calling endOfStream() before SourceBuffer.remove() completes leaks memory.

According to memory-infra trace (attached) StreamParserBuffer is accumulating.

In after.html, SourceBuffer::remove posts SourceBuffer::RemoveAsyncPart task which deletes the StreamParserBuffer.

But when the SourceBuffer is removed from the media source (SourceBuffer::RemovedFromMediaSource), the task gets canceled (SourceBuffer::CancelRemove).

WebSourceBufferImpl is getting destroyed but it doesn't own StreamParserBuffer.

WebMediaPlayerImpl owns ChunkDemuxer. ChunkDemuxer owns ChunkDemuxerStream. ChunkDemuxerStream owns SourceBufferStream. SourceBufferStream owns StreamParser::BufferQueue. StreamParser::BufferQueue owns StreamParserBuffer.

I am just learning MSE but why can't we free all the related buffers when WebSourceBufferImpl gets destroyed?
 
trace_with_heap_dump.json.gz
336 KB Download

Sign in to add a comment