Use of memory-infra tool

12 views
Skip to first unread message

Adam Walls

unread,
Apr 23, 2025, 6:02:42 PMApr 23
to memor...@chromium.org
Hey folks, I am looking for some troubleshooting advice/assistance. I am running into some issues trying to capture Perfetto memory-infra traces - https://chromium.googlesource.com/chromium/src/+/HEAD/docs/memory-infra/README.md. I have not been able to capture memory trace info on my emulator running the preinstalled Chrome for Android. I also tested on a local build that I sideloaded and I verified that I had enable_base_tracing=true in my GN args. It seems the docs might be a bit outdated or I am just misconfiguring things. Here is a link to an example trace link - https://ui.perfetto.dev/#!/?s=4ef96eddecdb551bc111ebbb7bc5e9806da56b4c.

Has anyone used this tool successfully that has any gotchas that might be preventing this from working on my end?

--
Adam Walls | Software Engineer | avv...@google.com

Siddhartha S

unread,
Apr 23, 2025, 7:44:57 PMApr 23
to Adam Walls, memor...@chromium.org
It's been a while since I looked at this, but we might not have support to capture and display Chrome memory snapshots in Perfetto UI (This could have changed in the last 5 years).
You could just capture chrome memory trace using chrome://inspect/?trace#devices and select memory-infra. This should still work

--
You received this message because you are subscribed to the Google Groups "memory-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAOmws9t1g%2BecsZjNP2rSGFoLUEBx_rFrs23FhsjZ%3DTnFjn17-w%40mail.gmail.com.

Adam Walls

unread,
Apr 24, 2025, 12:47:30 PMApr 24
to Siddhartha S, memor...@chromium.org
Thanks! I'll give that a try.
Is there a way to capture this info from a CLI tool? I am hoping to automate some memory analysis to monitor regressions across releases.

Siddhartha S

unread,
Apr 24, 2025, 1:12:03 PMApr 24
to Adam Walls, chrometto-team, Ashwin Verleker, memor...@chromium.org
I'd suggest starting with just Android system memory metrics on chrome processes, adb meminfo dump, or getting data from /proc for chrome processes, rather than Chrome's memory metric details. While you could get less noise in measurements since you can measure V8 and Blink memory usage on the correct renderer, it can get confusing or a maintenance burden as Chrome evolves these metrics in the long term.

If you are building an automated system, I'd not rely on memory-infra tooling based on legacy chrome://tracing. Perfetto traces should ideally support the memory snapshots. +chrometto-team for more recent information.

Chrome speed team also has benchmarks that measure memory metrics which you can potentially reuse: @Ashwin Verleker might be able to help here.

Egor Pasko

unread,
Apr 24, 2025, 2:55:15 PMApr 24
to Adam Walls, Siddhartha S, memor...@chromium.org
On Thu, Apr 24, 2025 at 6:47 PM 'Adam Walls' via memory-dev <memor...@chromium.org> wrote:
Thanks! I'll give that a try.
Is there a way to capture this info from a CLI tool? I am hoping to automate some memory analysis to monitor regressions across releases.

Telemetry (tools/perf/run_benchmark and third_party/catapult) has this automation (using the legacy tracing format and UI). It enables the necessary tracing categories in the browser. When the browser starts, Telemetry scripts connect to the devtools socket and send commands over this connection to pull memory dumps (among other things). When Telemetry issues a "stop tracing" command to the browser, all the memory dumps appear as part of the dumped trace (somewhere in the output directory).

We've been asking Perfetto maintainers to implement memory-infra flow in the Perfetto traceviewer. It has not gotten development attention in years. 
 

Lalit Maganti

unread,
Apr 24, 2025, 3:03:00 PMApr 24
to Egor Pasko, Primiano Tucci, Eric Seckler, Adam Walls, Siddhartha S, memor...@chromium.org
> We've been asking Perfetto maintainers to implement memory-infra flow in the Perfetto traceviewer. It has not gotten development attention in years. 

+Primiano Tucci +Eric Seckler 

Folks this is a very inaccurate representation of the state of affairs. We are not responsible for building stuff for Chrome and it's not correct is to expect us to do anything about this. 

For one, we don't get any staffing from Chrome to work on Chrome related things. We barely have enough staffing for Android related requests (android actually funds us) and we often have to turn even those away and relentlessly stack rank and prioritise. 

The Chrometto team who was responsible for building things integrations between Perfetto and Chrome have been charged (I believe by leadership) into actually doing performance investigations and fixing things instead of doing infra related things. 

This means that there is no one who is working on the infra parts of Chrome full time. There are people like +Etienne Pierre-doray who very graciously donate their free time to fix issues but afaik this is best effort time only, they don't get rewarded for this work. 

If you care about things like this, convince Chrome leadership to actually fund tracing infra and say that things like this are important and matter. Otherwise things will continue to work on autopilot until an inevitable breaking point. 

Adam Walls

unread,
Apr 24, 2025, 9:06:57 PMApr 24
to Lalit Maganti, Egor Pasko, Primiano Tucci, Eric Seckler, Siddhartha S, memor...@chromium.org
Thanks for the feedback everyone! It looks like things are mostly working with the telemetry benchmarking scripts.

There is a slight hiccup with the tooling for me. I get the error
ServiceException: 401 Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
Normally this just means using gsutil config, gcloud auth login, or download_from_google_storage --config, but none of those solutions worked for me. 

The README seems to indicate you can use this if you are a partner, and I am guessing Googlers can as well. Is this an inaccuracy with the doc or should I file a bug to troubleshoot gsutil issues further? Possibly relevant, I recently moved to the Youtube org where I was previously working on Android WebView.

Egor Pasko

unread,
Apr 25, 2025, 10:18:42 AMApr 25
to Adam Walls, Lalit Maganti, Primiano Tucci, Eric Seckler, Siddhartha S, memor...@chromium.org
Hey Adam, I forwarded your bucket permission request to internal support chat.
Reply all
Reply to author
Forward
0 new messages