how to clean up FlutterEngine

91 views
Skip to first unread message

Jim Xu

unread,
Oct 27, 2019, 9:39:29 AM10/27/19
to Flutter Development (flutter-dev)
hi, recently, I need to lazy start FlutterEngine, and clean up it on demand. I did it as following:
1. set all plugin's methodChannel as nil
2. dealloc all FlutterViewController
3. Underlying the Engine, I set the leak_vm setting as false, so it will not keep dart VM
4. At last, I can see FlutterEngine is dealloced, DartVM are deconstructed, Dart Isolates, DartVMData are also deconstructed. However, from the instruments or memory graph, there still are 30M memory persisted. I guessed part of them could be code/text segments of Flutter.framework, but I am not sure. Can anybody give a more reasonable explanation? Following is the screenshot of instrument, according the timestamp, it seems the flutter library has dealloced all the memory. Thanks in advance.

Jim Xu

unread,
Oct 27, 2019, 10:02:37 PM10/27/19
to Flutter Development (flutter-dev)
attach the image again:

ss.png

 

Jim Xu

unread,
Oct 28, 2019, 9:40:49 AM10/28/19
to Flutter Development (flutter-dev)
Can anybody help? It annoyed me so much:)
Reply all
Reply to author
Forward
0 new messages