feat(webview): Log PartitionAlloc allocated objects memory to UMA [chromium/src : main]

7 views
Skip to first unread message

Chidera Olibie (Gerrit)

unread,
Jun 16, 2026, 7:01:11 AMJun 16
to Code Review Nudger, Chromium LUCI CQ, Alex Mitra, Michael van Ouwerkerk, Benoit Lize, Stephen Nusko, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org
Attention needed from Alex Mitra, Benoit Lize and Michael van Ouwerkerk

Chidera Olibie added 1 comment

File android_webview/browser/metrics/memory_metrics_logger.cc
Line 61, Patchset 13: std::optional<uint64_t> malloc_pa_committed_bytes =
Chidera Olibie . resolved

Spoke to Benoit offline and I decided that Malloc PA allocated bytes is what we need for WebView. It tracks how much live objects exist at a time and would be useful in determining memory leaks and overall allocation growth for WebView.

"Size" tracks both allocated objects size and other metrics such as overhead, etc. The size metrics for malloc/partition is currently being overcounted, see b/524274622. So in addition to not being precise enough, it's also currently inaccurate.

I've removed the specific malloc/partition/allocator metrics. While allocator is the main partition, there's nothing stopping the team from adding other partitions in the future. So I'm sticking to malloc/partition which is the parent node for partition alloc allocations. However, this means I've had to add the allocated_objects_size scalar to the parent node.

cc: alex...@chromium.org, li...@chromium.org

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Mitra
  • Benoit Lize
  • Michael van Ouwerkerk
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: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
Gerrit-Change-Number: 7878789
Gerrit-PatchSet: 15
Gerrit-Owner: Chidera Olibie <col...@google.com>
Gerrit-Reviewer: Alex Mitra <alex...@chromium.org>
Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
Gerrit-Reviewer: Chidera Olibie <col...@google.com>
Gerrit-Reviewer: Michael van Ouwerkerk <mvanou...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Stephen Nusko <nus...@chromium.org>
Gerrit-Attention: Benoit Lize <li...@chromium.org>
Gerrit-Attention: Alex Mitra <alex...@chromium.org>
Gerrit-Attention: Michael van Ouwerkerk <mvanou...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Jun 2026 11:00:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael van Ouwerkerk (Gerrit)

unread,
Jun 16, 2026, 7:49:30 AMJun 16
to Chidera Olibie, Michael van Ouwerkerk, Code Review Nudger, Chromium LUCI CQ, Alex Mitra, Benoit Lize, Stephen Nusko, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org
Attention needed from Alex Mitra, Benoit Lize and Chidera Olibie

Michael van Ouwerkerk voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Mitra
  • Benoit Lize
  • Chidera Olibie
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
    Gerrit-Change-Number: 7878789
    Gerrit-PatchSet: 15
    Gerrit-Owner: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Alex Mitra <alex...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Michael van Ouwerkerk <mvanou...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Stephen Nusko <nus...@chromium.org>
    Gerrit-Attention: Benoit Lize <li...@chromium.org>
    Gerrit-Attention: Alex Mitra <alex...@chromium.org>
    Gerrit-Attention: Chidera Olibie <col...@google.com>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 11:49:04 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Mitra (Gerrit)

    unread,
    Jun 16, 2026, 8:33:16 AMJun 16
    to Chidera Olibie, Michael van Ouwerkerk, Code Review Nudger, Chromium LUCI CQ, Benoit Lize, Stephen Nusko, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org
    Attention needed from Benoit Lize and Chidera Olibie

    Alex Mitra voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Benoit Lize
    • Chidera Olibie
    Gerrit-Attention: Chidera Olibie <col...@google.com>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 12:32:56 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Benoit Lize (Gerrit)

    unread,
    Jun 18, 2026, 8:51:31 AMJun 18
    to Chidera Olibie, Alex Mitra, Michael van Ouwerkerk, Code Review Nudger, Chromium LUCI CQ, Stephen Nusko, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org
    Attention needed from Chidera Olibie

    Benoit Lize voted and added 1 comment

    Votes added by Benoit Lize

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 15 (Latest):
    Benoit Lize . resolved

    lgtm, thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chidera Olibie
    Gerrit-Attention: Chidera Olibie <col...@google.com>
    Gerrit-Comment-Date: Thu, 18 Jun 2026 12:51:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Chidera Olibie (Gerrit)

    unread,
    Jun 18, 2026, 8:58:59 AMJun 18
    to Stephen Nusko, Benoit Lize, Alex Mitra, Michael van Ouwerkerk, Code Review Nudger, Chromium LUCI CQ, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org
    Attention needed from Stephen Nusko

    Chidera Olibie added 1 comment

    File android_webview/browser/metrics/memory_metrics_logger.cc
    Line 61, Patchset 13: std::optional<uint64_t> malloc_pa_committed_bytes =
    Chidera Olibie . resolved

    Spoke to Benoit offline and I decided that Malloc PA allocated bytes is what we need for WebView. It tracks how much live objects exist at a time and would be useful in determining memory leaks and overall allocation growth for WebView.

    "Size" tracks both allocated objects size and other metrics such as overhead, etc. The size metrics for malloc/partition is currently being overcounted, see b/524274622. So in addition to not being precise enough, it's also currently inaccurate.

    I've removed the specific malloc/partition/allocator metrics. While allocator is the main partition, there's nothing stopping the team from adding other partitions in the future. So I'm sticking to malloc/partition which is the parent node for partition alloc allocations. However, this means I've had to add the allocated_objects_size scalar to the parent node.

    cc: alex...@chromium.org, li...@chromium.org

    Chidera Olibie

    cc nus...@chromium.org for malloc_dump_provider update.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Stephen Nusko
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
    Gerrit-Change-Number: 7878789
    Gerrit-PatchSet: 15
    Gerrit-Owner: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Alex Mitra <alex...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Michael van Ouwerkerk <mvanou...@chromium.org>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Jun 2026 12:58:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Chidera Olibie <col...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Stephen Nusko (Gerrit)

    unread,
    Jun 19, 2026, 12:16:33 AMJun 19
    to Chidera Olibie, Benoit Lize, Alex Mitra, Michael van Ouwerkerk, Code Review Nudger, Chromium LUCI CQ, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org
    Attention needed from Chidera Olibie

    Stephen Nusko voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chidera Olibie
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
    Gerrit-Change-Number: 7878789
    Gerrit-PatchSet: 15
    Gerrit-Owner: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Alex Mitra <alex...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Michael van Ouwerkerk <mvanou...@chromium.org>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Chidera Olibie <col...@google.com>
    Gerrit-Comment-Date: Fri, 19 Jun 2026 04:15:52 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chidera Olibie (Gerrit)

    unread,
    Jun 19, 2026, 3:25:17 AMJun 19
    to Stephen Nusko, Benoit Lize, Alex Mitra, Michael van Ouwerkerk, Code Review Nudger, Chromium LUCI CQ, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org

    Chidera Olibie voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
    Gerrit-Change-Number: 7878789
    Gerrit-PatchSet: 15
    Gerrit-Owner: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Alex Mitra <alex...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Michael van Ouwerkerk <mvanou...@chromium.org>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Comment-Date: Fri, 19 Jun 2026 07:24:55 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jun 19, 2026, 5:01:54 AMJun 19
    to Chidera Olibie, Stephen Nusko, Benoit Lize, Alex Mitra, Michael van Ouwerkerk, Code Review Nudger, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    feat(webview): Log PartitionAlloc allocated objects memory to UMA

    Add periodic logging of WebView's PartitionAlloc memory to UMA using
    MemoryMetricsLogger.

    This requests "malloc/partitions" memory and grabs the
    allocated_objects_size, and logs them to
    Memory.Browser.PartitionAlloc.Malloc.AllocatedObjects

    See internal doc (go/webview-partitionalloc-uma-metrics) for more
    details.
    Bug: 518755657
    Change-Id: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
    Commit-Queue: Chidera Olibie <col...@google.com>
    Reviewed-by: Alex Mitra <alex...@chromium.org>
    Reviewed-by: Michael van Ouwerkerk <mvanou...@chromium.org>
    Reviewed-by: Benoit Lize <li...@chromium.org>
    Reviewed-by: Stephen Nusko <nus...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1649552}
    Files:
    • M android_webview/browser/metrics/memory_metrics_logger.cc
    • M android_webview/javatests/src/org/chromium/android_webview/test/MemoryMetricsLoggerTest.java
    • M base/trace_event/malloc_dump_provider.cc
    • M tools/metrics/histograms/metadata/memory/histograms.xml
    Change size: S
    Delta: 4 files changed, 43 insertions(+), 1 deletion(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Stephen Nusko, +1 by Michael van Ouwerkerk, +1 by Alex Mitra, +1 by Benoit Lize
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I648a9c0e656055aecc90c1bb55c2fbaa805f8e4a
    Gerrit-Change-Number: 7878789
    Gerrit-PatchSet: 16
    Gerrit-Owner: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Alex Mitra <alex...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Chidera Olibie <col...@google.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Michael van Ouwerkerk <mvanou...@chromium.org>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages