perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

show memory used per app UI

Open wjj1928 opened this issue 2 years ago • 7 comments

I would like to request a feature to show used memory by app from UI. current UI has multiple items there but not easy to understand how much memory used by app.

I run sql to query and got below results: ts value counter_name


23527792117480 0.0 mem.locked
23527792117480 8646656.0 mem.rss
23527792117480 2510848.0 mem.rss.anon
23527792117480 4268032.0 mem.rss.file
23527792117480 1867776.0 mem.rss.shmem
23527792117480 15683584.0 mem.rss.watermark 23527792117480 4403200.0 mem.swap
23533607442061 6975488.0 mem.unreclaimable 23527792117480 12837453824.0 mem.virt

Or please help direct which combination should be the used memory by app? Is it mem.rss.file + mem.rss.anon?

wjj1928 avatar Dec 15 '23 15:12 wjj1928

@aMayzner can answer this question.

LalitMaganti avatar Dec 15 '23 19:12 LalitMaganti

The memory types you are most likely looking for are anon RSS and swap. To query:

SELECT RUN_METRIC('android/process_mem.sql');
SELECT * FROM anon_and_swap_span;

To see it in the UI you can use the Debug track functionality.

  1. Load the trace
  2. Run the query
  3. You will see values in the lower part of the page. When you click Show debug track button, you can visualise the data from any query. Make sure to set the debug track type to counter and value to value column.

I will migrate this table to standard library, so it's easier to access.

aMayzner avatar Dec 19 '23 14:12 aMayzner

Good, thanks,

would you please help show me where is the "show trace button"? I just run the SQL query from UI and saw the output list, but do not find "show debug trace button" from the page.

wjj1928 avatar Dec 19 '23 16:12 wjj1928

image

aMayzner avatar Dec 19 '23 16:12 aMayzner

Wow, after switch to timeline view, yes, I saw that button, I changed it to counter and the value to anon_free_and_swap, but after confirmed, nothing happen! image

wjj1928 avatar Dec 19 '23 16:12 wjj1928

image

aMayzner avatar Dec 19 '23 17:12 aMayzner

Great, many thanks

wjj1928 avatar Dec 19 '23 18:12 wjj1928