[android] Document Java heap metrics [chromium/src : main]

2 views
Skip to first unread message

Benoit Lize (Gerrit)

unread,
Oct 28, 2025, 6:42:50 AM (13 days ago) Oct 28
to Egor Pasko, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Egor Pasko

Benoit Lize voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Egor Pasko
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
Gerrit-Change-Number: 7089536
Gerrit-PatchSet: 2
Gerrit-Owner: Benoit Lize <li...@chromium.org>
Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
Gerrit-Reviewer: Egor Pasko <pa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Egor Pasko <pa...@chromium.org>
Gerrit-Comment-Date: Tue, 28 Oct 2025 10:42:34 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Egor Pasko (Gerrit)

unread,
Oct 28, 2025, 9:21:16 AM (13 days ago) Oct 28
to Benoit Lize, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Benoit Lize

Egor Pasko voted and added 1 comment

Votes added by Egor Pasko

Code-Review+1

1 comment

File tools/metrics/histograms/metadata/memory/histograms.xml
Line 132, Patchset 2 (Latest): summary="Only counting memory used by Java heap in Android. This is the
heap size, not actual allocated memory from the app. See
Egor Pasko . unresolved

My inner perfectionist says this remains confusing to read :/

The metric reports difference between Java totalMemory() and freeMemory(). Can we say that explicitly in the doc? I believe this simple formula explains the matter quicker than references to live objects, the way GC works and the differences with v8.

Overall what I learned today:

The word 'heap' is ambiguous, the part 'allocated_objects' is a lie. Ideally we should rename them, but I am not sure what changes in tooling that would involve. Clarification LGTM with those nits above.

Open in Gerrit

Related details

Attention is currently required from:
  • Benoit Lize
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
    Gerrit-Change-Number: 7089536
    Gerrit-PatchSet: 2
    Gerrit-Owner: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Egor Pasko <pa...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Benoit Lize <li...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Oct 2025 13:20:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Benoit Lize (Gerrit)

    unread,
    Oct 28, 2025, 12:00:58 PM (13 days ago) Oct 28
    to Egor Pasko, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

    Benoit Lize added 2 comments

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

    Thanks!

    File tools/metrics/histograms/metadata/memory/histograms.xml
    Line 132, Patchset 2: summary="Only counting memory used by Java heap in Android. This is the

    heap size, not actual allocated memory from the app. See
    Egor Pasko . resolved

    My inner perfectionist says this remains confusing to read :/

    The metric reports difference between Java totalMemory() and freeMemory(). Can we say that explicitly in the doc? I believe this simple formula explains the matter quicker than references to live objects, the way GC works and the differences with v8.

    Overall what I learned today:

    The word 'heap' is ambiguous, the part 'allocated_objects' is a lie. Ideally we should rename them, but I am not sure what changes in tooling that would involve. Clarification LGTM with those nits above.

    Benoit Lize

    The metric reports totalMemory(), not totalMemory() - freeMemory(). This would be another metric that I was considering adding, but that would not provide a lot of value for the reasons above.

    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: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
      Gerrit-Change-Number: 7089536
      Gerrit-PatchSet: 3
      Gerrit-Owner: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Egor Pasko <pa...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Comment-Date: Tue, 28 Oct 2025 16:00:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Egor Pasko <pa...@chromium.org>
      satisfied_requirement
      open
      diffy

      Egor Pasko (Gerrit)

      unread,
      Oct 28, 2025, 1:39:45 PM (13 days ago) Oct 28
      to Benoit Lize, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Benoit Lize

      Egor Pasko voted and added 2 comments

      Votes added by Egor Pasko

      Code-Review+1

      2 comments

      Patchset-level comments
      Egor Pasko . resolved

      still lgtm

      File tools/metrics/histograms/metadata/memory/histograms.xml
      Line 132, Patchset 2: summary="Only counting memory used by Java heap in Android. This is the
      heap size, not actual allocated memory from the app. See
      Egor Pasko . resolved

      My inner perfectionist says this remains confusing to read :/

      The metric reports difference between Java totalMemory() and freeMemory(). Can we say that explicitly in the doc? I believe this simple formula explains the matter quicker than references to live objects, the way GC works and the differences with v8.

      Overall what I learned today:

      The word 'heap' is ambiguous, the part 'allocated_objects' is a lie. Ideally we should rename them, but I am not sure what changes in tooling that would involve. Clarification LGTM with those nits above.

      Benoit Lize

      The metric reports totalMemory(), not totalMemory() - freeMemory(). This would be another metric that I was considering adding, but that would not provide a lot of value for the reasons above.

      Egor Pasko

      sorry, I was thinking it is about another metric. Saying that it is totalMemory() would be better then.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Benoit Lize
      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: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
      Gerrit-Change-Number: 7089536
      Gerrit-PatchSet: 3
      Gerrit-Owner: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Egor Pasko <pa...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Benoit Lize <li...@chromium.org>
      Gerrit-Comment-Date: Tue, 28 Oct 2025 17:39:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Egor Pasko <pa...@chromium.org>
      Comment-In-Reply-To: Benoit Lize <li...@chromium.org>
      satisfied_requirement
      open
      diffy

      Benoit Lize (Gerrit)

      unread,
      Oct 29, 2025, 4:50:22 AM (12 days ago) Oct 29
      to Egor Pasko, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

      Benoit Lize 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: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
      Gerrit-Change-Number: 7089536
      Gerrit-PatchSet: 3
      Gerrit-Owner: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Egor Pasko <pa...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Comment-Date: Wed, 29 Oct 2025 08:50:06 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Oct 29, 2025, 4:55:58 AM (12 days ago) Oct 29
      to Benoit Lize, Egor Pasko, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      [android] Document Java heap metrics
      Bug: b:455782509
      Change-Id: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
      Reviewed-by: Egor Pasko <pa...@chromium.org>
      Commit-Queue: Benoit Lize <li...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1537171}
      Files:
      • M base/trace_event/java_heap_dump_provider_android.cc
      • M tools/metrics/histograms/metadata/memory/histograms.xml
      Change size: S
      Delta: 2 files changed, 17 insertions(+), 1 deletion(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Egor Pasko
      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: I4f4ff411bbc4ac4d76ad23b1a9854f75625c7c37
      Gerrit-Change-Number: 7089536
      Gerrit-PatchSet: 4
      Gerrit-Owner: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Egor Pasko <pa...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages