Repository: flutter
Issue: [camera] Unexpected memory usage on iOS
Labels: platform-ios,p: camera,package,perf: memory,has reproducible steps,P2,found in release: 2.2,found in release: 2.5,team-ios,triaged-ios

Found an issue dealing with Flutter core functionality: when the camera opens on iOS, then we face high memory usage. Please check the attached screenshot of the Xcode Instruments and a link to the application, as well as logs. Does anyone face the same issue?



<details> 
<summary>screenshots</summary> 

<img width="418" alt="Screenshot 2021-08-24 at 17 37 07" src="https://user-images.githubusercontent.com/84508364/130640616-09cbdfa1-d272-4dc5-8074-8a3ca950ebd2.png">

![f7e29150-0573-11ec-8f1f-f6d50a8f41f2](https://user-images.githubusercontent.com/84508364/130751271-c0918cd9-f841-456e-a26b-02e486b5cd1b.png)

![09e0fe64-0574-11ec-acfb-faca6eb95f45](https://user-images.githubusercontent.com/84508364/130751120-5e417bd3-755b-4479-82b3-4c2f1a8d4e9e.png)

![231745fa-0574-11ec-8493-faca6eb95f45](https://user-images.githubusercontent.com/84508364/130751135-0aad059e-7999-4bf3-bb61-4825159e37e5.png)

![image](https://user-images.githubusercontent.com/84508364/130751145-e4643785-9c2b-478a-a3d2-3d509e6ec8da.png)

</details>

[example app](https://github.com/umbrellait-timur-khismatullin/ios_camera_memory_issue)



<details>
  <summary>Logs</summary>
iPhone 7, iOs 14.0, Channel stable 2.2.0

[flutter run --verbose.txt](https://github.com/flutter/flutter/files/7041108/flutter.run.--verbose.txt)



```
Analyzing ios_camera_memory_issue...                                    
No issues found! (ran in 1.7s)
```


```
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
    • Flutter version 2.2.0 at /Users/nikitakhilobok/Documents/flutter
    • Framework revision b22742018b (3 months ago), 2021-05-14 19:12:57 -0700
    • Engine revision a9d88a4d18
    • Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/nikitakhilobok/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/nikitakhilobok/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1
[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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-b3-6915495)
[✓] VS Code (version 1.58.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0
[✓] Connected device (4 available)
    • Pixel 2 (mobile)       • 192.168.0.14:41686                       • android-arm64  • Android 11 (API 30)
    • iPhone (Test) (mobile) • 2bf90be17a0f6983501e24b4830ea2ebb86e869d • ios            • iOS 14.0
    • macOS (desktop)        • macos                                    • darwin-x64     • macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)           • chrome                                   • web-javascript • Google Chrome 92.0.4515.159
• No issues found!
```

iPhone 11 Pro, iOs 14.7.1, Channel master 2.5.0-7.0.pre.228

[master iphone 11 flutter run --verbose.txt](https://github.com/flutter/flutter/files/7044939/master.iphone.11.flutter.run.--verbose.txt)


```
Analyzing ios_camera_memory_issue-master...               
No issues found! (ran in 14.1s)
```

```
[✓] Flutter (Channel master, 2.5.0-7.0.pre.228, on macOS 11.3.1 20E241 darwin-x64, locale en-AD)
    • Flutter version 2.5.0-7.0.pre.228 at /Users/sergeyterentyev/Documents/flutter_develop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ac05e7e3fe (3 hours ago), 2021-08-25 00:41:06 -0400
    • Engine revision a9efb963de
    • Dart version 2.15.0 (build 2.15.0-43.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/sergeyterentyev/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 12.5.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 11.0.8+10-b944.6916264)

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio 2.app/Contents
    • 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-b3-6915495)

[✓] Connected device (2 available)
    • UmbrellaIT-IPhone 11 Pro.Black (mobile) • 00008030-001A69001E13802E • ios            • iOS 14.7.1 18G82
    • Chrome (web)                            • chrome                    • web-javascript • Google Chrome 92.0.4515.159
    ! Device 4T89571EA1953103824 is not authorized.
      You might need to check your device for an authorization dialog.

! Doctor found issues in 1 category.
```

</details>