Skip to content

A flutter tool to check memory leak by dart VMService

License

Notifications You must be signed in to change notification settings

asjqkkkk/memory_checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

import 'package:memory_checker/memory_checker.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      ...
      navigatorObservers: [
        LeakObserver()
      ],
    );
  }
}

LeakObserver will notify if there are some leaks found by VMService

Welcome for pr: https://github.com/asjqkkkk/memory_checker/compare

Welcome for issue: https://github.com/asjqkkkk/memory_checker/issues/new

Notice

If you meet this error: Bad state: Insecure HTTP is not allowed by platform

you need add some file to solve this problem

Android

This behavior may be omitted following migration guide: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android.

add in android/app/src/main/AndroidManifest.xml:

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="receipt"
        android:usesCleartextTraffic="true" <!-- This Line -->
        android:icon="@mipmap/ic_launcher">

iOS

Allow insecure/HTTP requests globally across your application on iOS, you can add this to your ios/Runner/info.plist under the main dictionary definition:

<key>NSAppTransportSecurity</key>
<dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
</dict>

Be warned that you will need to have an explanation for Apple's review team when enabling this, otherwise your app will get rejected on submission.

(see Bad state: Insecure HTTP is not allowed by platform)

Performance

If there is a page leak:

image

Then tap it:

image

And you can see the leak retainpath:

image

About

A flutter tool to check memory leak by dart VMService

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages