Remove unused JavaHeapProfiler and JavaHeapDumpGenerator [chromium/src : main]

1 view
Skip to first unread message

Kartar Singh (Gerrit)

unread,
Jul 1, 2026, 10:10:54 AM (2 days ago) Jul 1
to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org
Attention needed from Stephen Nusko

Kartar Singh added 1 comment

File base/test/android/java/src/org/chromium/base/GarbageCollectionTestUtils.java
Line 53, Patchset 1 (Latest): // try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());
Kartar Singh . unresolved

I am unsure whether this actually works it was AI generated, should we just remove the whole comment?

Open in Gerrit

Related details

Attention is currently required from:
  • Stephen Nusko
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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
Gerrit-Change-Number: 7956537
Gerrit-PatchSet: 1
Gerrit-Owner: Kartar Singh <karta...@google.com>
Gerrit-Reviewer: Kartar Singh <karta...@google.com>
Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
Gerrit-Comment-Date: Wed, 01 Jul 2026 14:10:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stephen Nusko (Gerrit)

unread,
Jul 1, 2026, 9:22:18 PM (2 days ago) Jul 1
to Kartar Singh, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org
Attention needed from Kartar Singh

Stephen Nusko voted and added 1 comment

Votes added by Stephen Nusko

Code-Review+1

1 comment

File base/test/android/java/src/org/chromium/base/GarbageCollectionTestUtils.java
Line 53, Patchset 1 (Latest): // try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());
Kartar Singh . unresolved

I am unsure whether this actually works it was AI generated, should we just remove the whole comment?

Stephen Nusko

Rather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?

Open in Gerrit

Related details

Attention is currently required from:
  • Kartar Singh
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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
Gerrit-Change-Number: 7956537
Gerrit-PatchSet: 1
Gerrit-Owner: Kartar Singh <karta...@google.com>
Gerrit-Reviewer: Kartar Singh <karta...@google.com>
Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
Gerrit-Attention: Kartar Singh <karta...@google.com>
Gerrit-Comment-Date: Thu, 02 Jul 2026 01:21:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Kartar Singh <karta...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kartar Singh (Gerrit)

unread,
Jul 2, 2026, 6:07:09 AM (yesterday) Jul 2
to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org

Kartar Singh added 1 comment

File base/test/android/java/src/org/chromium/base/GarbageCollectionTestUtils.java

// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());
Kartar Singh . resolved

I am unsure whether this actually works it was AI generated, should we just remove the whole comment?

Stephen Nusko

Rather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?

Kartar Singh

Sounds good. Removed the code and updated the comment to reference the docs.

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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
    Gerrit-Change-Number: 7956537
    Gerrit-PatchSet: 2
    Gerrit-Owner: Kartar Singh <karta...@google.com>
    Gerrit-Reviewer: Kartar Singh <karta...@google.com>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Jul 2026 10:06:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
    Comment-In-Reply-To: Kartar Singh <karta...@google.com>
    satisfied_requirement
    open
    diffy

    Kartar Singh (Gerrit)

    unread,
    Jul 2, 2026, 6:07:23 AM (yesterday) Jul 2
    to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org

    Kartar Singh 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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
    Gerrit-Change-Number: 7956537
    Gerrit-PatchSet: 2
    Gerrit-Owner: Kartar Singh <karta...@google.com>
    Gerrit-Reviewer: Kartar Singh <karta...@google.com>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Jul 2026 10:07:03 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Kartar Singh (Gerrit)

    unread,
    Jul 2, 2026, 9:10:05 AM (yesterday) Jul 2
    to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org
    Attention needed from Stephen Nusko

    Kartar Singh added 1 comment

    File base/test/android/java/src/org/chromium/base/GarbageCollectionTestUtils.java
    Line 53, Patchset 1: // try {
    // android.os.Debug.dumpHprofData(filePath);
    // Log.e("MemoryDump", "Heap dump captured at: " + filePath);
    // } catch (java.io.IOException e) {
    // Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
    // e.getMessage());
    Kartar Singh . resolved

    I am unsure whether this actually works it was AI generated, should we just remove the whole comment?

    Stephen Nusko

    Rather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?

    Kartar Singh

    Sounds good. Removed the code and updated the comment to reference the docs.

    Kartar Singh

    Okay it's obsolete now 😄.
    Some [new usage](https://crrev.com/c/8014041) of JavaHeapDumpGenerator was added meanwhile, so ended up keeping the class and the comment.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Stephen Nusko
    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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
      Gerrit-Change-Number: 7956537
      Gerrit-PatchSet: 3
      Gerrit-Owner: Kartar Singh <karta...@google.com>
      Gerrit-Reviewer: Kartar Singh <karta...@google.com>
      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
      Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Jul 2026 13:09:44 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Stephen Nusko (Gerrit)

      unread,
      Jul 2, 2026, 8:42:42 PM (22 hours ago) Jul 2
      to Kartar Singh, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org
      Attention needed from Kartar Singh

      Stephen Nusko voted and added 1 comment

      Votes added by Stephen Nusko

      Code-Review+1

      1 comment

      File base/test/android/java/src/org/chromium/base/GarbageCollectionTestUtils.java
      Line 53, Patchset 1: // try {
      // android.os.Debug.dumpHprofData(filePath);
      // Log.e("MemoryDump", "Heap dump captured at: " + filePath);
      // } catch (java.io.IOException e) {
      // Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
      // e.getMessage());
      Kartar Singh . resolved

      I am unsure whether this actually works it was AI generated, should we just remove the whole comment?

      Stephen Nusko

      Rather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?

      Kartar Singh

      Sounds good. Removed the code and updated the comment to reference the docs.

      Kartar Singh

      Okay it's obsolete now 😄.
      Some [new usage](https://crrev.com/c/8014041) of JavaHeapDumpGenerator was added meanwhile, so ended up keeping the class and the comment.

      Stephen Nusko

      Fair enough, just removing the native side SGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Kartar Singh
      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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
        Gerrit-Change-Number: 7956537
        Gerrit-PatchSet: 3
        Gerrit-Owner: Kartar Singh <karta...@google.com>
        Gerrit-Reviewer: Kartar Singh <karta...@google.com>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-Attention: Kartar Singh <karta...@google.com>
        Gerrit-Comment-Date: Fri, 03 Jul 2026 00:42:05 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Kartar Singh (Gerrit)

        unread,
        1:28 AM (18 hours ago) 1:28 AM
        to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org

        Kartar Singh 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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
        Gerrit-Change-Number: 7956537
        Gerrit-PatchSet: 3
        Gerrit-Owner: Kartar Singh <karta...@google.com>
        Gerrit-Reviewer: Kartar Singh <karta...@google.com>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-Comment-Date: Fri, 03 Jul 2026 05:28:39 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        1:36 AM (17 hours ago) 1:36 AM
        to Kartar Singh, Stephen Nusko, chromium...@chromium.org, agriev...@chromium.org, lizeb...@chromium.org, nyquis...@chromium.org, pasko...@chromium.org, spang...@chromium.org, torne...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, yfriedm...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Remove unused JavaHeapProfiler and JavaHeapDumpGenerator

        This CL removes the unused `JavaHeapProfiler` class and its helper
        classes in `services/tracing/public/cpp/perfetto/java_heap_profiler`.
        `JavaHeapProfiler::GetInstance()` was not called anywhere, making this
        dead code.

        Additionally, this CL removes `JavaHeapDumpGenerator` from `base`,
        as it was only used by `JavaHeapProfiler` and in a commented-out
        debugging block in `GarbageCollectionTestUtils.java`.
        Bug: b/524922141
        Change-Id: Ic2fbb26592d250b71887d05f6f7334095ea4befb
        Commit-Queue: Kartar Singh <karta...@google.com>
        Reviewed-by: Stephen Nusko <nus...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1656359}
        Files:
        • M base/BUILD.gn
        • M base/android/java/src/org/chromium/base/memory/JavaHeapDumpGenerator.java
        • D base/android/java_heap_dump_generator.cc
        • D base/android/java_heap_dump_generator.h
        • M content/browser/tracing/tracing_controller_impl.cc
        • M services/tracing/BUILD.gn
        • M services/tracing/DEPS
        • M services/tracing/public/cpp/BUILD.gn
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_buffer_android.cc
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_buffer_android.h
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_buffer_android_unittest.cc
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_data_type_android.h
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_instances_android.cc
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_instances_android.h
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_parser_android.cc
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_parser_android.h
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/hprof_parser_android_unittest.cc
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/java_heap_profiler_android.cc
        • D services/tracing/public/cpp/perfetto/java_heap_profiler/java_heap_profiler_android.h
        • M services/tracing/public/cpp/perfetto/perfetto_config.cc
        • M services/tracing/public/cpp/perfetto/perfetto_data_source_names.h
        Change size: XL
        Delta: 21 files changed, 0 insertions(+), 2194 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Stephen Nusko
        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: Ic2fbb26592d250b71887d05f6f7334095ea4befb
        Gerrit-Change-Number: 7956537
        Gerrit-PatchSet: 4
        Gerrit-Owner: Kartar Singh <karta...@google.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Kartar Singh <karta...@google.com>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages