+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?
|
Deleted:
trace_with_heap_dump.json.gz
336 KB
|
|
trace_with_heap_dump.json.gz
336 KB
Download
|