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

Issue 2309523002: DOM Storage: Populate commit batch values lazily to avoid memory bloat (Closed)

Created:
4 years, 3 months ago by jsbell
Modified:
4 years, 3 months ago
Reviewers:
michaeln, DmitrySkiba
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DOM Storage: Populate commit batch values lazily to avoid memory bloat DOM Storage (a.k.a. localStorage and sessionStorage) flushes changes to disks on a timer. It previously held updated keys/values in both an in-memory map and a "commit batch" of pending updates to write. For large values (which are common) this duplicated memory until the timer fired. To avoid this, keep only the keys in the commit batch until just before we toss the batch over to the commit thread, and at that point grab the values from the in-memory map. BUG=640698 R=michaeln@chromium.org,dskiba@chromium.org Committed: https://crrev.com/8f224809c2603590ed31259f3d2f0e69494ee417 Cr-Commit-Position: refs/heads/master@{#416652}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Actually save the memory #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -1 line) Patch
M content/browser/dom_storage/dom_storage_area.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_area.cc View 1 4 chunks +15 lines, -1 line 0 comments Download

Messages

Total messages: 22 (13 generated)
jsbell
michaeln@ - please take a look?
4 years, 3 months ago (2016-09-02 19:22:10 UTC) #4
michaeln
lgtm almost https://codereview.chromium.org/2309523002/diff/1/content/browser/dom_storage/dom_storage_area.cc File content/browser/dom_storage/dom_storage_area.cc (right): https://codereview.chromium.org/2309523002/diff/1/content/browser/dom_storage/dom_storage_area.cc#newcode199 content/browser/dom_storage/dom_storage_area.cc:199: commit_batch->changed_values[key] = base::NullableString16(value, false); looks like you ...
4 years, 3 months ago (2016-09-02 22:39:57 UTC) #7
michaeln
Something like this makes sense for LevelDBWrapperImpl too. At some point, that class will replace ...
4 years, 3 months ago (2016-09-02 22:46:30 UTC) #8
jsbell
https://codereview.chromium.org/2309523002/diff/1/content/browser/dom_storage/dom_storage_area.cc File content/browser/dom_storage/dom_storage_area.cc (right): https://codereview.chromium.org/2309523002/diff/1/content/browser/dom_storage/dom_storage_area.cc#newcode199 content/browser/dom_storage/dom_storage_area.cc:199: commit_batch->changed_values[key] = base::NullableString16(value, false); On 2016/09/02 22:39:57, michaeln wrote: ...
4 years, 3 months ago (2016-09-02 22:54:20 UTC) #11
jsbell
On 2016/09/02 22:46:30, michaeln wrote: > Something like this makes sense for LevelDBWrapperImpl too. At ...
4 years, 3 months ago (2016-09-02 23:08:41 UTC) #12
michaeln
On 2016/09/02 23:08:41, jsbell wrote: > On 2016/09/02 22:46:30, michaeln wrote: > > Something like ...
4 years, 3 months ago (2016-09-02 23:30:27 UTC) #13
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/2309523002/20001
4 years, 3 months ago (2016-09-06 16:30:49 UTC) #18
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 3 months ago (2016-09-06 17:45:39 UTC) #20
commit-bot: I haz the power
4 years, 3 months ago (2016-09-06 17:48:12 UTC) #22
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/8f224809c2603590ed31259f3d2f0e69494ee417
Cr-Commit-Position: refs/heads/master@{#416652}

Powered by Google App Engine
This is Rietveld 408576698