Closed Bug 1379091 Opened 5 years ago Closed 5 years ago

Don't prevent MemoryBlockCache post-init buffer growth


(Core :: Audio/Video: Playback, enhancement, P1)

56 Branch



Tracking Status
firefox56 --- fixed


(Reporter: mozbugz, Assigned: mozbugz)




(2 files)

MemoryBlockCache records the following telemetry:!compare=architecture&measure=MEMORYBLOCKCACHE_ERRORS

Results so far show that in some <1% cases we hit 4=WriteBlockCannotGrow, which means we needed to grow the buffer (because the file was actually larger than initially hinted by the HTML content-length) but hit the allowed combined limit of all MemoryBlockCache. This is only visible on 32-bit systems so far, probably because they have the smallest amount of memory.

Because of this, we are preventing further playback of these files, which is not acceptable.

One easy solution would be to just disable MemoryBlockCache on 32-bit systems.
But I'm afraid this issue will appear on 64-bit systems once we hit more populous beta and then release versions.
So I think we should have a proper handling for these.

I believe it should be possible for the MemoryBlockCache to instantiate a FileBlockCache, move all of its data there (I/Os are done in a separate thread anyway), and then channel subsequent calls directly to the FileBlockCache.
I've just realized that a memory-backed MediaCache could limit how much it uses its MemoryBlockCache, by tailoring GetMaxBlocks(). Much easier!
Changing bug title to avoid future confusion, as we're not really handling MemoryBlockCache growth failures, but just making them not happen anymore (apart from OOM).
Summary: Handle failure to grow MemoryBlockCache → Don't prevent MemoryBlockCache post-init buffer growth
Comment on attachment 8884680 [details]
Bug 1379091 - Let block cache tell MediaCache its block use limit -
Attachment #8884680 - Flags: review?(cpearce) → review+
Comment on attachment 8884681 [details]
Bug 1379091 - Don't prevent MemoryBlockCache overuse -
Attachment #8884681 - Flags: review?(cpearce) → review+
Pushed by
Let block cache tell MediaCache its block use limit - r=cpearce
Don't prevent MemoryBlockCache overuse - r=cpearce
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Depends on: 1397528
No longer depends on: 1397528
You need to log in before you can comment on or make changes to this bug.