Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Issue 2605993002: Experiment with more aggressive MSE GC on memory pressure (Closed)

Created:
3 years, 11 months ago by servolk
Modified:
3 years, 10 months ago
CC:
apacible+watch_chromium.org, chromium-reviews, erickung+watch_chromium.org, feature-media-reviews_chromium.org, miu+watch_chromium.org, posciak+watch_chromium.org, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Experiment with more aggressive MSE GC on memory pressure Add an experimental ReduceMSEBuffersOnMemoryPressure feature that will make MSE garbage collection algorithm more aggresive when we are under moderate or critical memory pressure. Until now the MSE GC algorithm didn't try very hard to free up memory as long as we are under hard-coded memory cap (150MB for video, 12MB for audio). With this CL the GC algorithm will halve the effective SourceBuffer memory limits under moderate memory pressure and will release as much stale data as possible under critical memory pressure. BUG=672976 Review-Url: https://codereview.chromium.org/2605993002 Cr-Commit-Position: refs/heads/master@{#447245} Committed: https://chromium.googlesource.com/chromium/src/+/f94b4608f14a23fcc7e1a1d0f7a01c4a6fca8bb0

Patch Set 1 #

Patch Set 2 : Fix test failures #

Patch Set 3 : Log total released bytes #

Patch Set 4 : buildfix #

Patch Set 5 : Fixed GC logic, use stream memory limit #

Patch Set 6 : wip #

Patch Set 7 : rebase #

Patch Set 8 : wip #

Patch Set 9 : Allow MSE GC to happen in EOS state now #

Total comments: 3

Patch Set 10 : Keep current memory level in SBS and use it during GC #

Patch Set 11 : Make immediate GC optional + add tests #

Patch Set 12 : Add separate feature for memory pressure + improve new tests #

Patch Set 13 : Don't create mem pressure listener when the feature is disabled #

Total comments: 19

Patch Set 14 : Move memory listener creation closer to ChunkDemuxer creation #

Patch Set 15 : updated tests #

Patch Set 16 : typo #

Total comments: 5

Patch Set 17 : Improve feature handling (CR feedback) #

Total comments: 20

Patch Set 18 : CR feedback #

Total comments: 6

Patch Set 19 : nits #

Total comments: 6

Patch Set 20 : CR feedback #

Patch Set 21 : rebase/resolve conflicts #

Unified diffs Side-by-side diffs Delta from patch set Stats (+285 lines, -7 lines) Patch
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +7 lines, -0 lines 0 comments Download
M content/public/common/common_param_traits_macros.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/web_preferences.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/common/web_preferences.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -0 lines 0 comments Download
M media/base/media_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +6 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +12 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +41 lines, -1 line 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -1 line 0 comments Download
M media/blink/webmediaplayer_params.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +6 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_params.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +2 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +11 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +22 lines, -0 lines 0 comments Download
M media/filters/source_buffer_state.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +12 lines, -0 lines 0 comments Download
M media/filters/source_buffer_state.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +20 lines, -0 lines 0 comments Download
M media/filters/source_buffer_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +15 lines, -0 lines 0 comments Download
M media/filters/source_buffer_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +40 lines, -5 lines 0 comments Download
M media/filters/source_buffer_stream_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +78 lines, -0 lines 0 comments Download

Messages

Total messages: 140 (97 generated)
DaleCurtis
3 years, 11 months ago (2017-01-12 19:52:40 UTC) #39
DaleCurtis
Why does WMPI need to know about memory pressure? Seems this could be directly integrated ...
3 years, 11 months ago (2017-01-12 19:52:56 UTC) #40
servolk
On 2017/01/12 19:52:56, DaleCurtis wrote: > Why does WMPI need to know about memory pressure? ...
3 years, 11 months ago (2017-01-12 19:59:54 UTC) #41
wolenetz
MSE v1 standard only allows GC during appendBuffer()'s first steps. Yet this CL does it ...
3 years, 11 months ago (2017-01-12 22:21:49 UTC) #43
chcunningham
https://codereview.chromium.org/2605993002/diff/160001/media/filters/source_buffer_stream.cc File media/filters/source_buffer_stream.cc (right): https://codereview.chromium.org/2605993002/diff/160001/media/filters/source_buffer_stream.cc#newcode828 media/filters/source_buffer_stream.cc:828: // Try removing data from the back of the ...
3 years, 11 months ago (2017-01-12 22:31:26 UTC) #44
chcunningham
Also, I looked at the memory UMAs from https://codereview.chromium.org/2568303002/ I don't have any surprising insights, ...
3 years, 11 months ago (2017-01-12 22:43:39 UTC) #45
servolk
On 2017/01/12 22:21:49, wolenetz wrote: > MSE v1 standard only allows GC during appendBuffer()'s first ...
3 years, 11 months ago (2017-01-12 22:52:44 UTC) #46
servolk
https://codereview.chromium.org/2605993002/diff/160001/media/filters/chunk_demuxer.h File media/filters/chunk_demuxer.h (right): https://codereview.chromium.org/2605993002/diff/160001/media/filters/chunk_demuxer.h#newcode276 media/filters/chunk_demuxer.h:276: // |bytes_released| is an optional output parameter, if non-null ...
3 years, 11 months ago (2017-01-12 22:58:41 UTC) #47
servolk
On 2017/01/12 22:31:26, chcunningham_ooo_jan11 wrote: > https://codereview.chromium.org/2605993002/diff/160001/media/filters/source_buffer_stream.cc > File media/filters/source_buffer_stream.cc (right): > > https://codereview.chromium.org/2605993002/diff/160001/media/filters/source_buffer_stream.cc#newcode828 > ...
3 years, 11 months ago (2017-01-12 23:16:02 UTC) #48
servolk
On 2017/01/12 22:52:44, servolk wrote: > On 2017/01/12 22:21:49, wolenetz wrote: > > MSE v1 ...
3 years, 11 months ago (2017-01-13 01:57:37 UTC) #51
wolenetz
I think the critical memory pressure mode of background GC's unexpected changing of buffered memory ...
3 years, 11 months ago (2017-01-13 18:28:48 UTC) #54
servolk
On 2017/01/13 18:28:48, wolenetz wrote: > I think the critical memory pressure mode of background ...
3 years, 11 months ago (2017-01-17 17:43:42 UTC) #55
wolenetz
On 2017/01/17 17:43:42, servolk wrote: > On 2017/01/13 18:28:48, wolenetz wrote: > > I think ...
3 years, 11 months ago (2017-01-18 01:09:34 UTC) #56
wolenetz
On 2017/01/18 01:09:34, wolenetz wrote: > On 2017/01/17 17:43:42, servolk wrote: > > On 2017/01/13 ...
3 years, 11 months ago (2017-01-18 01:11:31 UTC) #57
servolk
On 2017/01/18 01:11:31, wolenetz wrote: > On 2017/01/18 01:09:34, wolenetz wrote: > > On 2017/01/17 ...
3 years, 11 months ago (2017-01-19 19:01:10 UTC) #62
chcunningham
On 2017/01/12 23:16:02, servolk wrote: > On 2017/01/12 22:31:26, chcunningham_ooo_jan11 wrote: > > > https://codereview.chromium.org/2605993002/diff/160001/media/filters/source_buffer_stream.cc ...
3 years, 11 months ago (2017-01-20 00:14:43 UTC) #63
servolk
On 2017/01/20 00:14:43, chcunningham wrote: > On 2017/01/12 23:16:02, servolk wrote: > > On 2017/01/12 ...
3 years, 11 months ago (2017-01-23 18:04:29 UTC) #70
chcunningham
Looking pretty good. Great tests. https://codereview.chromium.org/2605993002/diff/240001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/2605993002/diff/240001/media/blink/webmediaplayer_impl.cc#newcode1749 media/blink/webmediaplayer_impl.cc:1749: memory_pressure_listener_ = Do we ...
3 years, 11 months ago (2017-01-25 03:47:15 UTC) #75
servolk
https://codereview.chromium.org/2605993002/diff/240001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/2605993002/diff/240001/media/blink/webmediaplayer_impl.cc#newcode1749 media/blink/webmediaplayer_impl.cc:1749: memory_pressure_listener_ = On 2017/01/25 03:47:15, chcunningham wrote: > Do ...
3 years, 11 months ago (2017-01-25 18:06:47 UTC) #77
chcunningham
https://codereview.chromium.org/2605993002/diff/240001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/2605993002/diff/240001/media/blink/webmediaplayer_impl.cc#newcode1749 media/blink/webmediaplayer_impl.cc:1749: memory_pressure_listener_ = On 2017/01/25 18:06:47, servolk wrote: > On ...
3 years, 11 months ago (2017-01-25 22:21:57 UTC) #81
servolk
https://codereview.chromium.org/2605993002/diff/240001/media/filters/source_buffer_state.cc File media/filters/source_buffer_state.cc (right): https://codereview.chromium.org/2605993002/diff/240001/media/filters/source_buffer_state.cc#newcode313 media/filters/source_buffer_state.cc:313: // takes up the most memory and that's where ...
3 years, 11 months ago (2017-01-26 18:10:14 UTC) #88
chcunningham
Thanks! LGTM
3 years, 11 months ago (2017-01-26 19:12:20 UTC) #89
DaleCurtis
https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc File media/base/media_switches.cc (right): https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc#newcode167 media/base/media_switches.cc:167: // Reduce memory limits for MSE SourceBuffers under memory ...
3 years, 11 months ago (2017-01-26 19:24:51 UTC) #90
servolk
https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc File media/base/media_switches.cc (right): https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc#newcode167 media/base/media_switches.cc:167: // Reduce memory limits for MSE SourceBuffers under memory ...
3 years, 11 months ago (2017-01-26 19:38:31 UTC) #91
DaleCurtis
https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc File media/base/media_switches.cc (right): https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc#newcode167 media/base/media_switches.cc:167: // Reduce memory limits for MSE SourceBuffers under memory ...
3 years, 11 months ago (2017-01-26 19:48:33 UTC) #92
servolk
On 2017/01/26 19:48:33, DaleCurtis wrote: > https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc > File media/base/media_switches.cc (right): > > https://codereview.chromium.org/2605993002/diff/300001/media/base/media_switches.cc#newcode167 > ...
3 years, 11 months ago (2017-01-26 20:11:58 UTC) #93
DaleCurtis
Yes, though I was hoping the bugs that required we need it passed in that ...
3 years, 11 months ago (2017-01-26 20:17:12 UTC) #94
servolk
On 2017/01/26 20:17:12, DaleCurtis wrote: > Yes, though I was hoping the bugs that required ...
3 years, 11 months ago (2017-01-26 22:24:17 UTC) #98
servolk
On 2017/01/26 22:24:17, servolk wrote: > On 2017/01/26 20:17:12, DaleCurtis wrote: > > Yes, though ...
3 years, 11 months ago (2017-01-26 22:26:10 UTC) #100
Alexei Svitkine (slow)
On 2017/01/26 22:24:17, servolk wrote: > On 2017/01/26 20:17:12, DaleCurtis wrote: > > Yes, though ...
3 years, 11 months ago (2017-01-26 22:28:15 UTC) #101
DaleCurtis
https://codereview.chromium.org/2605993002/diff/320001/content/browser/renderer_host/render_view_host_impl.cc File content/browser/renderer_host/render_view_host_impl.cc (right): https://codereview.chromium.org/2605993002/diff/320001/content/browser/renderer_host/render_view_host_impl.cc#newcode553 content/browser/renderer_host/render_view_host_impl.cc:553: // TODO(avayvod, asvitkine): Query the value directly when it ...
3 years, 11 months ago (2017-01-26 23:07:37 UTC) #103
DaleCurtis
https://codereview.chromium.org/2605993002/diff/320001/media/filters/source_buffer_stream.cc File media/filters/source_buffer_stream.cc (right): https://codereview.chromium.org/2605993002/diff/320001/media/filters/source_buffer_stream.cc#newcode722 media/filters/source_buffer_stream.cc:722: if (!base::FeatureList::IsEnabled(kReduceMSEBuffersOnMemoryPressure)) { Also drop {} from single line ...
3 years, 11 months ago (2017-01-26 23:08:42 UTC) #104
servolk
https://codereview.chromium.org/2605993002/diff/320001/content/browser/renderer_host/render_view_host_impl.cc File content/browser/renderer_host/render_view_host_impl.cc (right): https://codereview.chromium.org/2605993002/diff/320001/content/browser/renderer_host/render_view_host_impl.cc#newcode553 content/browser/renderer_host/render_view_host_impl.cc:553: // TODO(avayvod, asvitkine): Query the value directly when it ...
3 years, 11 months ago (2017-01-27 00:52:13 UTC) #108
DaleCurtis
lgtm % some nits, again defer on variations to metrics folk. https://codereview.chromium.org/2605993002/diff/340001/media/filters/chunk_demuxer.h File media/filters/chunk_demuxer.h (right): ...
3 years, 11 months ago (2017-01-27 00:58:23 UTC) #110
servolk
https://codereview.chromium.org/2605993002/diff/340001/media/filters/chunk_demuxer.h File media/filters/chunk_demuxer.h (right): https://codereview.chromium.org/2605993002/diff/340001/media/filters/chunk_demuxer.h#newcode73 media/filters/chunk_demuxer.h:73: bool force_gc); On 2017/01/27 00:58:23, DaleCurtis wrote: > s/force_gc/force_instant_gc/ ...
3 years, 11 months ago (2017-01-27 01:16:17 UTC) #111
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_state.h File media/filters/source_buffer_state.h (right): https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_state.h#newcode79 media/filters/source_buffer_state.h:79: void OnMemoryPressure( Comment? https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_stream.h File media/filters/source_buffer_stream.h (right): https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_stream.h#newcode97 ...
3 years, 10 months ago (2017-01-27 18:03:20 UTC) #116
servolk
https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_state.h File media/filters/source_buffer_state.h (right): https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_state.h#newcode79 media/filters/source_buffer_state.h:79: void OnMemoryPressure( On 2017/01/27 18:03:19, Alexei Svitkine (very slow) ...
3 years, 10 months ago (2017-01-28 02:23:57 UTC) #117
servolk
On 2017/01/28 02:23:57, servolk wrote: > https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_state.h > File media/filters/source_buffer_state.h (right): > > https://codereview.chromium.org/2605993002/diff/360001/media/filters/source_buffer_state.h#newcode79 > ...
3 years, 10 months ago (2017-01-28 02:24:55 UTC) #121
Tom Sepez
Messages LGTM
3 years, 10 months ago (2017-01-30 18:13:44 UTC) #130
servolk
On 2017/01/30 18:13:44, Tom Sepez wrote: > Messages LGTM Thanks! Ping dgozman@ for content/ changes.
3 years, 10 months ago (2017-01-30 23:31:22 UTC) #133
dgozman
content lgtm
3 years, 10 months ago (2017-01-31 03:59:43 UTC) #134
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2605993002/400001
3 years, 10 months ago (2017-01-31 16:37:01 UTC) #137
commit-bot: I haz the power
3 years, 10 months ago (2017-01-31 16:45:08 UTC) #140
Message was sent while issue was closed.
Committed patchset #21 (id:400001) as
https://chromium.googlesource.com/chromium/src/+/f94b4608f14a23fcc7e1a1d0f7a0...

Powered by Google App Engine
This is Rietveld 408576698