Add memory dumping support for IndexedDB SQLite connections. [chromium/src : main]

0 views
Skip to first unread message

Xiaohan Zhao (Gerrit)

unread,
May 8, 2026, 4:16:17 AM (14 days ago) May 8
to Steve Becker, Evan Stade, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, dmurph+wa...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, spang...@chromium.org, storage...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Evan Stade and Steve Becker

Xiaohan Zhao added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Xiaohan Zhao . resolved

Hi folks, PTAL when you have a chance, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Evan Stade
  • Steve Becker
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iaf253a9bb32ad3a4a07868d5e92878a33c3e32c6
Gerrit-Change-Number: 7807951
Gerrit-PatchSet: 2
Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
Gerrit-Attention: Evan Stade <evan...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Comment-Date: Fri, 08 May 2026 08:15:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Evan Stade (Gerrit)

unread,
May 8, 2026, 4:04:55 PM (13 days ago) May 8
to Xiaohan Zhao, Abhishek Shanthkumar, Steve Becker, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, dmurph+wa...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, spang...@chromium.org, storage...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Abhishek Shanthkumar, Steve Becker and Xiaohan Zhao

Evan Stade added 5 comments

Patchset-level comments
Evan Stade . resolved

self to cc, Abhishek ptal.

Commit Message
Line 9, Patchset 2 (Latest):Bug: 40253999
Evan Stade . unresolved

can you file a more specific bug for this please?

File base/trace_event/memory_infra_background_allowlist.cc
Line 337, Patchset 2 (Latest): "site_storage/index_db/db_0x?",
Evan Stade . unresolved

nit: these should be indexed_db

Line 338, Patchset 2 (Latest): "site_storage/index_db/memenv_0x?",
Evan Stade . unresolved

memenv and db both seem unused? When did that become the case? Can we fix this?

File content/browser/indexed_db/instance/bucket_context.cc
Line 1116, Patchset 2 (Latest): static_cast<sqlite::BackingStoreImpl*>(backing_store())
Evan Stade . unresolved

all interaction with the backing store (except construction) should go through the backing store interface, meaning this cast should not be necessary.

Open in Gerrit

Related details

Attention is currently required from:
  • Abhishek Shanthkumar
  • Steve Becker
  • Xiaohan Zhao
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iaf253a9bb32ad3a4a07868d5e92878a33c3e32c6
    Gerrit-Change-Number: 7807951
    Gerrit-PatchSet: 2
    Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Reviewer: Abhishek Shanthkumar <abhishek.s...@microsoft.com>
    Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-CC: Evan Stade <evan...@microsoft.com>
    Gerrit-Attention: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Attention: Abhishek Shanthkumar <abhishek.s...@microsoft.com>
    Gerrit-Attention: Steve Becker <ste...@microsoft.com>
    Gerrit-Comment-Date: Fri, 08 May 2026 20:04:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Abhishek Shanthkumar (Gerrit)

    unread,
    May 11, 2026, 8:51:46 AM (10 days ago) May 11
    to Xiaohan Zhao, Evan Stade, Steve Becker, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, dmurph+wa...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, spang...@chromium.org, storage...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Steve Becker and Xiaohan Zhao

    Abhishek Shanthkumar added 4 comments

    Patchset-level comments
    Abhishek Shanthkumar . resolved

    Thanks for taking this up! I had just started looking into it after seeing your other CL for DomStorage. Glad you are on it.

    Commit Message
    Line 7, Patchset 2 (Latest):Add memory dumping support for IndexedDB SQLite connections.
    Abhishek Shanthkumar . unresolved

    Can we briefly describe the name and structure of the memory dumps being added?

    File base/trace_event/memory_infra_background_allowlist.cc
    Line 338, Patchset 2 (Latest): "site_storage/index_db/memenv_0x?",
    Evan Stade . unresolved

    memenv and db both seem unused? When did that become the case? Can we fix this?

    File content/browser/indexed_db/instance/bucket_context.cc
    Line 1116, Patchset 2 (Latest): static_cast<sqlite::BackingStoreImpl*>(backing_store())
    Evan Stade . unresolved

    all interaction with the backing store (except construction) should go through the backing store interface, meaning this cast should not be necessary.

    Abhishek Shanthkumar

    Adding to this, I believe we need to redefine what memory dumps IndexedDB makes in the SQLite world. Currently, with LevelDB:
    1. `BucketContext::OnMemoryDump` dumps in-flight memory.
    2. `TransactionalLevelDBDatabase::OnMemoryDump` dumps db memory size + leveldb file name.

    Both of the above emit to the same identifier presumably so that in-flight memory can be mapped to the origin (gleanable from the levelDB file name that appears against the db memory entry).

    In the SQLite case, the existing `DatabaseMemoryDumpProvider::OnMemoryDump` dumps useful sizes under the "IndexedDB_connection" component, with the tag being the address of the specific instance.

    It would be good to:

    • Sum and report all those individual db sizes under the `site_storage/index_db` component (similar to (2) for LevelDB above) per origin (BucketContext instance), and
    • Continue providing some attribution from opaque identifiers to the origin, similar to (1) for LevelDB above.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Steve Becker
    • Xiaohan Zhao
    Gerrit-Attention: Steve Becker <ste...@microsoft.com>
    Gerrit-Comment-Date: Mon, 11 May 2026 12:51:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Evan Stade <evan...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Zhao (Gerrit)

    unread,
    May 14, 2026, 3:50:11 PM (7 days ago) May 14
    to Abhishek Shanthkumar, Evan Stade, Steve Becker, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, dmurph+wa...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, spang...@chromium.org, storage...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Abhishek Shanthkumar and Steve Becker

    Xiaohan Zhao added 1 comment

    File content/browser/indexed_db/instance/bucket_context.cc
    Line 1116, Patchset 2 (Latest): static_cast<sqlite::BackingStoreImpl*>(backing_store())
    Evan Stade . unresolved

    all interaction with the backing store (except construction) should go through the backing store interface, meaning this cast should not be necessary.

    Abhishek Shanthkumar

    Adding to this, I believe we need to redefine what memory dumps IndexedDB makes in the SQLite world. Currently, with LevelDB:
    1. `BucketContext::OnMemoryDump` dumps in-flight memory.
    2. `TransactionalLevelDBDatabase::OnMemoryDump` dumps db memory size + leveldb file name.

    Both of the above emit to the same identifier presumably so that in-flight memory can be mapped to the origin (gleanable from the levelDB file name that appears against the db memory entry).

    In the SQLite case, the existing `DatabaseMemoryDumpProvider::OnMemoryDump` dumps useful sizes under the "IndexedDB_connection" component, with the tag being the address of the specific instance.

    It would be good to:

    • Sum and report all those individual db sizes under the `site_storage/index_db` component (similar to (2) for LevelDB above) per origin (BucketContext instance), and
    • Continue providing some attribution from opaque identifiers to the origin, similar to (1) for LevelDB above.
    Xiaohan Zhao

    Thanks @abhishek.s...@microsoft.com! I want to make sure I implement the intended dump shape.

    For SQLite, do you want a single bucket-scoped total dump like `site_storage/indexed_db/sqlite_0x<bucket>` whose size is the sum of all open SQLite connections for that `BucketContext`, plus per-connection child dumps linked/suballocated to the existing `sqlite/IndexedDB_connection/0x...` dumps for attribution?

    Also, when you say "per origin (BucketContext instance)", should this be scoped per `BucketContext` rather than adding up all buckets for the same origin?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Abhishek Shanthkumar
    • Steve Becker
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iaf253a9bb32ad3a4a07868d5e92878a33c3e32c6
    Gerrit-Change-Number: 7807951
    Gerrit-PatchSet: 2
    Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Reviewer: Abhishek Shanthkumar <abhishek.s...@microsoft.com>
    Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-CC: Evan Stade <evan...@microsoft.com>
    Gerrit-Attention: Abhishek Shanthkumar <abhishek.s...@microsoft.com>
    Gerrit-Attention: Steve Becker <ste...@microsoft.com>
    Gerrit-Comment-Date: Thu, 14 May 2026 19:50:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Evan Stade <evan...@microsoft.com>
    Comment-In-Reply-To: Abhishek Shanthkumar <abhishek.s...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Abhishek Shanthkumar (Gerrit)

    unread,
    May 15, 2026, 8:09:04 AM (6 days ago) May 15
    to Xiaohan Zhao, Evan Stade, Steve Becker, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, dmurph+wa...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, spang...@chromium.org, storage...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Steve Becker and Xiaohan Zhao

    Abhishek Shanthkumar added 1 comment

    File content/browser/indexed_db/instance/bucket_context.cc
    Line 1116, Patchset 2 (Latest): static_cast<sqlite::BackingStoreImpl*>(backing_store())
    Evan Stade . unresolved

    all interaction with the backing store (except construction) should go through the backing store interface, meaning this cast should not be necessary.

    Abhishek Shanthkumar

    Adding to this, I believe we need to redefine what memory dumps IndexedDB makes in the SQLite world. Currently, with LevelDB:
    1. `BucketContext::OnMemoryDump` dumps in-flight memory.
    2. `TransactionalLevelDBDatabase::OnMemoryDump` dumps db memory size + leveldb file name.

    Both of the above emit to the same identifier presumably so that in-flight memory can be mapped to the origin (gleanable from the levelDB file name that appears against the db memory entry).

    In the SQLite case, the existing `DatabaseMemoryDumpProvider::OnMemoryDump` dumps useful sizes under the "IndexedDB_connection" component, with the tag being the address of the specific instance.

    It would be good to:

    • Sum and report all those individual db sizes under the `site_storage/index_db` component (similar to (2) for LevelDB above) per origin (BucketContext instance), and
    • Continue providing some attribution from opaque identifiers to the origin, similar to (1) for LevelDB above.
    Xiaohan Zhao

    Thanks @abhishek.s...@microsoft.com! I want to make sure I implement the intended dump shape.

    For SQLite, do you want a single bucket-scoped total dump like `site_storage/indexed_db/sqlite_0x<bucket>` whose size is the sum of all open SQLite connections for that `BucketContext`, plus per-connection child dumps linked/suballocated to the existing `sqlite/IndexedDB_connection/0x...` dumps for attribution?

    Also, when you say "per origin (BucketContext instance)", should this be scoped per `BucketContext` rather than adding up all buckets for the same origin?

    Abhishek Shanthkumar

    Yep, that sounds right structure-wise, thanks! We can iterate on the names (it kind of makes sense not to have "sqlite" in the name under indexed_db, but keeping it "db" to match LevelDB is also misleading) subsequently.

    Also, when you say "per origin (BucketContext instance)", should this be scoped per BucketContext rather than adding up all buckets for the same origin?

    `BucketContext` is one per origin (with the potential exception of special cases such as third-party origin embeddings), but yes, I do specifically mean one entry per `BucketContext`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Steve Becker
    • Xiaohan Zhao
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iaf253a9bb32ad3a4a07868d5e92878a33c3e32c6
    Gerrit-Change-Number: 7807951
    Gerrit-PatchSet: 2
    Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Reviewer: Abhishek Shanthkumar <abhishek.s...@microsoft.com>
    Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-CC: Evan Stade <evan...@microsoft.com>
    Gerrit-Attention: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Attention: Steve Becker <ste...@microsoft.com>
    Gerrit-Comment-Date: Fri, 15 May 2026 12:08:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Zhao <xiaoh...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages