flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.55k stars 319 forks source link

Address user dissatisfaction for memory screen. #6972

Open polina-c opened 8 months ago

polina-c commented 8 months ago
polina-c commented 8 months ago

motivation: b/316403803 (internal link)

mraleph commented 8 months ago

I don't know if this warrants a separate issue or not but I have tried using DevTools to debug https://github.com/flutter/flutter/issues/139650 and snapshotting just hang on me - and the heap was barely 100Mb. So in the end I could not use snapshot tab to solve it. I managed to use instance tracing though to figure it out, but the experience was poor (especially when you click snapshotting button and the whole tab just hangs on you).

polina-c commented 8 months ago

I don't know if this warrants a separate issue or not but I have tried using DevTools to debug flutter/flutter#139650 and snapshotting just hang on me - and the heap was barely 100Mb. So in the end I could not use snapshot tab to solve it. I managed to use instance tracing though to figure it out, but the experience was poor (especially when you click snapshotting button and the whole tab just hangs on you).

Thank you for reporting! You are using mac, right? What are CPU and memory numbers on the mac? How do you know that heap was 100Mb?

mraleph commented 8 months ago

You are using mac, right?

Yes. It's an M1 Mac Book Pro with 32 Gb of RAM.

How do you know that heap was 100Mb?

That's what devtools was showing me when I tried to take snapshot.

polina-c commented 8 months ago

That's what devtools was showing me when I tried to take snapshot.

On the chart, right?

mraleph commented 8 months ago

On the chart, right?

Yep, also on the table where various classes are listed together with instance count and instance sizes.

polina-c commented 5 months ago

@mraleph , performance of snapshotting is significantly improved on flutter master However, Chrome tab has limit 4 GB and will crash out of memory if a snapshot size is 3 GB or more. And, snapshot size is normally proportional to heap size.

So, you will need to build desktop DevTools to workaround this.

I will be happy to help if you face difficulties. Tweet me at @PolinaCC to setup video call.