New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 810906 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Lower demuxer stream limits on low-end Android devices

Project Member Reported by dskiba@chromium.org, Feb 9 2018

Issue description

Currently demuxer stream limits are 12MiB for audio and 150MiB for video, regardless of the platform.

This means that during long playbacks session renderer memory can grow considerably, and can result in OS killing Chrome once there is no more memory (phone also gets sluggish before that as Android tries hard to kill other processes / move pages into zram).

See b/72526988 for an example of Chrome dying on 512MiB device while playing long Youtube video.

We need to dynamically lower the limits based on the platform.
 
Cc: mariakho...@chromium.org

Comment 2 by dskiba@chromium.org, Feb 10 2018

Cc: erikc...@chromium.org

Comment 3 by dskiba@chromium.org, Feb 12 2018

Status: WontFix (was: Assigned)
Closing in favor of enabling MemoryPressureBasedSourceBufferGC feature (issue 811464).

Comment 4 by dskiba@chromium.org, Feb 15 2018

Cc: primiano@chromium.org
Status: Assigned (was: WontFix)
Reopening because the problem is quite urgent and running MemoryPressureBasedSourceBufferGC experiment can take considerable time.

Comment 5 by dskiba@chromium.org, Feb 15 2018

One other thing with the MemoryPressureBasedSourceBufferGC thing is that it relies on memory pressure signals, but Chrome can miss them, because they're sent right after renderer is started, and before any relevant listeners added. See /b/73310928.

Comment 6 by dskiba@chromium.org, Feb 15 2018

Issue 812648 has been merged into this issue.
Project Member

Comment 7 by bugdroid1@chromium.org, Feb 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/342574ee96b23c26d4a1949a04957c63295e42b0

commit 342574ee96b23c26d4a1949a04957c63295e42b0
Author: Dmitry Skiba <dskiba@chromium.org>
Date: Tue Feb 20 19:50:56 2018

Lower demuxer stream limits on low-end Android devices.

Currently demuxer stream limits are 12MiB for audio and 150MiB for video,
regardless of the platform. This means that when playing long videos Chrome
will slowly allocate up to 162MiB. Most low-end Android devices can't afford
allocating that much, which translates to bad user experience: first device
becomes sluggish, as OS tries hard to kill other processes / move memory to
zram. Eventually (since renderer keeps allocating) Android gives up and kills
Chrome.

Turns out that Chromecast had similar issues and ended up lowering demuxer
limits to 2MiB for audio / 30MiB for video.

This CL turns demuxer limit constants into functions and selects lower
values on low-end Android devices.

Bug:  810906 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I33fcd7d4916379abcb1f56cf9289928dfe3788a7
Reviewed-on: https://chromium-review.googlesource.com/922884
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dmitry Skiba <dskiba@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537853}
[modify] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/base/BUILD.gn
[delete] https://crrev.com/70a4ce306b0b6d4ef033dd02d73da7dc04f1799c/media/base/demuxer_memory_limit.cc
[modify] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/base/demuxer_memory_limit.h
[add] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/base/demuxer_memory_limit_default.cc
[add] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/base/demuxer_memory_limit_low.cc
[delete] https://crrev.com/70a4ce306b0b6d4ef033dd02d73da7dc04f1799c/media/base/demuxer_memory_limit_lowmem.cc
[add] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/base/demuxer_memory_limit_select.cc
[modify] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/filters/ffmpeg_demuxer.cc
[modify] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/filters/source_buffer_stream.cc
[modify] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/formats/mp4/track_run_iterator.cc
[modify] https://crrev.com/342574ee96b23c26d4a1949a04957c63295e42b0/media/media_options.gni

Comment 8 by dskiba@chromium.org, Feb 21 2018

Cc: haraken@chromium.org

Comment 9 by dskiba@chromium.org, Feb 22 2018

Status: Fixed (was: Assigned)

Sign in to add a comment