devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Unclear how to use the memory tab's Allocations function

Open xster opened this issue 2 years ago • 3 comments

What I would expect from the tool is that I click start somewhere, interact with the app for a bit, then click stop. Then it tracks every allocation and deallocation in the vm between those points, then show me a flame graph of all the leftover allocations with the widths being the sizes of those allocations.

Instead, when I click "Track" the first time, it seems to take a snapshot and show me all the classes. But there's 100 classes in a table. I'd want to track all of them. Do I click through each checkbox one by one?

xster avatar Jul 29 '22 07:07 xster

CC @bkonyi @polina-c

kenzieschmoll avatar Jul 29 '22 21:07 kenzieschmoll

Tracking all of them would be extremely expensive and bring any non-trivial program to a crawl, so we do tracking on a per-class basis. This screen is really buggy / broken at the moment, and we're working on a replacement that will allow for determining where allocations of tracked classes are being made in a similar format to the CPU profiler tree.

bkonyi avatar Aug 03 '22 16:08 bkonyi

is there an alternative suggested approach to solving this generic business need? Very generally, I want to be able to start a measurement at some time, go do some things and finish a measurement at some later time expecting zero leaks. If there are any newly allocated but not garbage collected allocations, I'd want a summary of what they are per class and if possible, retention tree. This seems like a common feature in Xcode and Android Studio.

xster avatar Oct 05 '22 21:10 xster