Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: Garbage Collection - How to check?

Tags:

flutter

In Flutter, how can I check if I am releasing (dispose) everything correctly?

I am building an application and I have the feeling that the simulator is getting slower after a series of hot reloads.

Many thanks for your answers.

like image 329
boeledi Avatar asked Jan 02 '23 07:01

boeledi


1 Answers

Dart comes with a debugger called Observatory. It does a bit of everything you need. From CPU/Memory usage, to time spent on each functions. Even breakpoints and code coverage.

When running your flutter app, it's available by default on the localhost.

When running flutter run in the terminal, the port will be displayed. On vscode with Dart code extension, you'll need to use the command Open Observatory timeline.

enter image description here

like image 128
Rémi Rousselet Avatar answered Jan 29 '23 01:01

Rémi Rousselet