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

Issue 2365943005: Cap memory usage in webp catch up (Closed)

Created:
4 years, 2 months ago by cblume
Modified:
4 years, 2 months ago
CC:
chromium-reviews, blink-reviews, jzern, skal, urvang
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cap memory usage in webp catch up Currently, the Blink decoders get purged between each call to decode. However, when the decoder needs to catch up, the cached frames are not purged. They accumulate until the catch up has completed, which causes a memory spike. This may not be as much of a problem for webp, which likely has a shorter catch up distance than gif (since it is more likely to resume from a near-by keyframe). Nevertheless, the memory spike should be avoided. BUG=636205 Committed: https://crrev.com/cfcf81cfe56e8e34b30222d25d0e9b5eaaaf4b45 Cr-Commit-Position: refs/heads/master@{#424331}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Simplifying overflow checks. #

Patch Set 3 : Simplifying another piece. #

Total comments: 11

Patch Set 4 : Rebasing. #

Patch Set 5 : Moving aggressive purge update into demuxer update. #

Total comments: 2

Patch Set 6 : Moving purge check out of conditional branch. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -0 lines) Patch
M third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (11 generated)
cblume
PTAL This is basically the WEBP version of what we did for GIF: https://crrev.com/2075093002
4 years, 2 months ago (2016-09-24 09:30:26 UTC) #2
skal
https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode536 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:536: return; indent is off https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode539 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:539: const uint64_t frameMemoryUsage ...
4 years, 2 months ago (2016-09-24 17:14:27 UTC) #4
skal
https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode440 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:440: clearCacheExceptFrame(*i); don't you want to reset m_purgeAggressively to false ...
4 years, 2 months ago (2016-09-24 17:15:53 UTC) #5
cblume
https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode440 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:440: clearCacheExceptFrame(*i); On 2016/09/24 17:15:53, skal wrote: > don't you ...
4 years, 2 months ago (2016-09-25 05:30:06 UTC) #6
scroggo_chromium
From the commit message: > This may not be as much of a problem for ...
4 years, 2 months ago (2016-09-26 12:04:48 UTC) #11
skal
https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode538 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:538: const uint64_t totalMemoryUsage = frameMemoryUsage * index; this multiply ...
4 years, 2 months ago (2016-09-26 12:22:51 UTC) #12
urvang
https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode440 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:440: clearCacheExceptFrame(*i); I think you need to purge after line#444. ...
4 years, 2 months ago (2016-09-26 18:37:05 UTC) #14
cblume
>I'm a little skeptical. If the memory spike is a problem in WEBP, and this ...
4 years, 2 months ago (2016-10-01 11:06:23 UTC) #15
urvang
I believe you'll submit the other patch -- moving common stuff to ImageDecoder -- and ...
4 years, 2 months ago (2016-10-03 19:12:36 UTC) #16
urvang
https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode416 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:416: updateAggressivePurging(index); You only need to call this method when ...
4 years, 2 months ago (2016-10-03 21:07:23 UTC) #17
cblume
https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode416 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:416: updateAggressivePurging(index); On 2016/10/03 21:07:23, urvang wrote: > You only ...
4 years, 2 months ago (2016-10-10 21:18:39 UTC) #18
urvang
https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/40001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode416 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:416: updateAggressivePurging(index); On 2016/10/10 21:18:38, cblume wrote: > On 2016/10/03 ...
4 years, 2 months ago (2016-10-10 21:30:50 UTC) #21
cblume
https://codereview.chromium.org/2365943005/diff/80001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp (right): https://codereview.chromium.org/2365943005/diff/80001/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp#newcode238 third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp:238: size_t frameCount = WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT); On 2016/10/10 21:30:50, urvang ...
4 years, 2 months ago (2016-10-10 21:36:38 UTC) #22
urvang
lgtm
4 years, 2 months ago (2016-10-10 22:33:27 UTC) #23
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/2365943005/100001
4 years, 2 months ago (2016-10-10 22:34:39 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 2 months ago (2016-10-11 01:27:05 UTC) #26
commit-bot: I haz the power
4 years, 2 months ago (2016-10-11 01:31:56 UTC) #28
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/cfcf81cfe56e8e34b30222d25d0e9b5eaaaf4b45
Cr-Commit-Position: refs/heads/master@{#424331}

Powered by Google App Engine
This is Rietveld 408576698