Closed Bug 1379091 Opened 4 years ago Closed 4 years ago

Don't prevent MemoryBlockCache post-init buffer growth

Categories

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

56 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: gerald, Assigned: gerald)

References

Details

Attachments

(2 files)

MemoryBlockCache records the following telemetry:
https://telemetry.mozilla.org/new-pipeline/dist.html#!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 -

https://reviewboard.mozilla.org/r/155538/#review160982
Attachment #8884680 - Flags: review?(cpearce) → review+
Comment on attachment 8884681 [details]
Bug 1379091 - Don't prevent MemoryBlockCache overuse -

https://reviewboard.mozilla.org/r/155540/#review160984
Attachment #8884681 - Flags: review?(cpearce) → review+
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/82220cb42a60
Let block cache tell MediaCache its block use limit - r=cpearce
https://hg.mozilla.org/integration/autoland/rev/a7e5cdf5c07f
Don't prevent MemoryBlockCache overuse - r=cpearce
https://hg.mozilla.org/mozilla-central/rev/82220cb42a60
https://hg.mozilla.org/mozilla-central/rev/a7e5cdf5c07f
Status: NEW → RESOLVED
Closed: 4 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.