Repository: flutter
Issue: webview_flutter has memory leak
Labels: platform-android,p: webview,package,perf: memory,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-android,triaged-android

I use webview_flutter plugin, I repeatedly enter and exit the WebViewExample page .The memory will grow all the time, 
_WebViewExampleState Instance grow，WebViewAndroidPlatformController also

![image](https://user-images.githubusercontent.com/38792098/149306896-e08e919c-fb6d-40eb-b0bc-1a07f347a5cf.png)

when i delete 【onProgress、navigationDelegate、onPageStarted、onPageFinished、onProgress、onWebViewCreated】，webview back to normal

please confirm what is the problem? thanks

about code，It is modified from the pub demo，
**_pubspec.yaml_**
i has try webview_flutter-2.8.0 and 3.0.0
```
...
dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.0
  path_provider: 2.0.1
  webview_flutter: 3.0.0

dependency_overrides:
  webview_flutter_android: 2.8.1
  webview_flutter_platform_interface: 1.8.0
  webview_flutter_wkwebview: 2.7.1
...
```

**_main.dart_**
```
import 'package:flutter/material.dart';
import 'package:flutter_test_app/webview_page.dart';

void main() => runApp(const MaterialApp(home: HomePage()));

class HomePage extends StatelessWidget {
  const HomePage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Test leak'),
      ),
      floatingActionButton: IconButton(
        icon: const Icon(Icons.add),
        onPressed: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (_) => const WebViewExample()),
          );
        },
      ),
      body: Container(),
    );
  }
}

```

**_webview_page.dart_**
```
import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class WebViewExample extends StatefulWidget {
  const WebViewExample({Key key}) : super(key: key);

  @override
  _WebViewExampleState createState() => _WebViewExampleState();
}

class _WebViewExampleState extends State<WebViewExample> {
  final Completer<WebViewController> _controller =
      Completer<WebViewController>();

  @override
  void initState() {
    super.initState();
    if (Platform.isAndroid) {
      WebView.platform = SurfaceAndroidWebView();
    }
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.green,
      appBar: AppBar(
        title: const Text('Flutter WebView example'),
      ),
      body: Builder(builder: (BuildContext context) {
        return WebView(
          initialUrl: 'https://flutter.cn',
          javascriptMode: JavascriptMode.unrestricted,
          onWebViewCreated: (WebViewController webViewController) {
            _controller.complete(webViewController);
          },
          onProgress: (int progress) {
            // ignore: avoid_print
            print('WebView is loading (progress : $progress%)');
          },
          javascriptChannels: <JavascriptChannel>{
            _toasterJavascriptChannel(context),
          },
          navigationDelegate: (NavigationRequest request) {
            if (request.url.startsWith('https://www.youtube.com/')) {
            // ignore: avoid_print
              print('blocking navigation to $request}');
              return NavigationDecision.prevent;
            }
            // ignore: avoid_print
            print('allowing navigation to $request');
            return NavigationDecision.navigate;
          },
          onPageStarted: (String url) {
            // ignore: avoid_print
            print('Page started loading: $url');
          },
          onPageFinished: (String url) {
            // ignore: avoid_print
            print('Page finished loading: $url');
          },
          gestureNavigationEnabled: true,
          backgroundColor: const Color(0x00000000),
        );
      }),
    );
  }

  JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
    return JavascriptChannel(
        name: 'Toaster',
        onMessageReceived: (JavascriptMessage message) {
          // ignore: deprecated_member_use
          Scaffold.of(context).showSnackBar(
            SnackBar(content: Text(message.message)),
          );
        });
  }
}

```

> flutter doctor -v

```
[√] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.19041.208], locale zh-CN)
    • Flutter version 2.5.1 at D:\Dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (4 months ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1)
    • Android Studio at D:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.63.2)
    • VS Code at C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] Connected device (2 available)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 97.0.4692.71

• No issues found!
```