Repository: flutter
Issue: [video_player] EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=2098 MB, unused=0x0)
Labels: c: crash,platform-ios,p: video_player,package,P2,c: fatal crash,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

I'm using `video_player` from more than one year in my production app. At the moment I can't give you a reproducible sample but with the latest version my users are experiencing random crashes when scroll on a page that contains a `VideoPlayer` widget.

**Actual results:** Application crash.

  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
[ +188 ms] Hot restart performed in 1,023ms.
[   +1 ms] Performing hot restart... (completed in 1,026ms)
[        ] Restarted application in 1,131ms.
[ +414 ms] VERBOSE: Initializing the OneSignal Flutter SDK (3.2.7)
[        ] VERBOSE: In app message click handler set successfully
[        ] VERBOSE: setAppId(id) called with appId: 48189a6f-72a9-450b-a07f-0a2f6211260b!
[        ] VERBOSE: setAppId(id) finished, checking if launchOptions has been set before proceeding...!
[        ] VERBOSE: setAppId(id) successful and launchOptions are set, initializing OneSignal...
[        ] VERBOSE: registerForPushNotifications Called:waitingForApnsResponse: 0
[        ] VERBOSE: Firing registerForRemoteNotifications
[        ] VERBOSE: registerUser:waitingForApnsResponse: 1
[        ] VERBOSE: registerUser:initializationTime: 2022-01-09 18:18:30 +0000
[        ] VERBOSE: registerUserNow
[        ] VERBOSE: Notification will show in foreground handler set successfully
[        ] WARNING: OneSignal has detected that your application delegate implements a deprecated method
(application:didReceiveLocalNotification:). Please note that this method has been officially deprecated and the OneSignal SDK will no longer call
it. You should use UNUserNotificationCenter instead
[        ] VERBOSE: registerUserInternal
[        ] VERBOSE: shouldRegisterNow:waitingForOneSReg: 0
[        ] VERBOSE: shouldRegisterNow:isImmediatePlayerCreateOrOnSession: 0
[        ] VERBOSE: shouldRegisterNow:isOnSessionSuccessfulForCurrentState: 1
[   +1 ms] VERBOSE: oneSignalDidRegisterForRemoteNotifications:deviceToken:
[        ] INFO: Device Registered with Apple: 79ebab537045fd87f48c49006446ff7f4d94463cb96110f233917f696affe317
[        ] VERBOSE: updateDeviceToken:onSuccess:onFailure:
[        ] VERBOSE: shouldRegisterNow:waitingForOneSReg: 0
[        ] VERBOSE: shouldRegisterNow:isImmediatePlayerCreateOrOnSession: 0
[        ] VERBOSE: shouldRegisterNow:isOnSessionSuccessfulForCurrentState: 1
[   +5 ms] VERBOSE: updateNotificationTypes called: 15
[   +1 ms] VERBOSE: Firing registerForRemoteNotifications
[        ] VERBOSE: startedRegister: 1
[        ] VERBOSE: getNotificationTypes:mSubscriptionStatus: -1
[   +1 ms] VERBOSE: getNotificationTypes:mSubscriptionStatus: -1
[        ] VERBOSE: oneSignalDidRegisterForRemoteNotifications:deviceToken:
[        ] INFO: Device Registered with Apple: 79ebab537045fd87f48c49006446ff7f4d94463cb96110f233917f696affe317
[        ] VERBOSE: updateDeviceToken:onSuccess:onFailure:
[        ] VERBOSE: shouldRegisterNow:waitingForOneSReg: 0
[        ] VERBOSE: shouldRegisterNow:isImmediatePlayerCreateOrOnSession: 0
[        ] VERBOSE: shouldRegisterNow:isOnSessionSuccessfulForCurrentState: 1
[+2157 ms] flutter: No walktrought SVGs preloaded
[        ] flutter: Now will load always necessary SVGs
[ +130 ms] VERBOSE: Notification opened handler set successfully
[+1813 ms] flutter: Loaded favourites: Articles:1 Tours:1
[ +266 ms] TX and TY are 0. Rotation: 0. Natural width,height: 1280.000000, 720.000000
[  +66 ms] flutter: There are not related sub articles for this article
[  +79 ms] flutter: There are not related sub articles for this article
[+2513 ms] flutter: Pause the parent/father widget video before launching full screen
[  +11 ms] flutter: Deactivate screen standby during full screen reproduction
[  +71 ms] TX and TY are 0. Rotation: 0. Natural width,height: 1280.000000, 720.000000
[+1455 ms] flutter: Restart parent/father widget video after launching full screen
[        ] flutter: Activate screen standby after full screen reproduction
[+1286 ms] Process 488 stopped
[        ] * thread #8, name = 'io.flutter.1.ui', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=2098 MB, unused=0x0)
[        ]     frame #0: 0x0000000107a49284 Flutter`dart::GCSweeper::SweepPage(dart::OldPage*, dart::FreeList*, bool) + 316
[        ] Flutter`dart::GCSweeper::SweepPage:
[        ] ->  0x107a49284 <+316>: stp    x19, x19, [x11], #0x10
[        ]     0x107a49288 <+320>: subs   x12, x12, #0x2            ; =0x2 
[        ]     0x107a4928c <+324>: b.ne   0x107a49284               ; <+316>
[        ]     0x107a49290 <+328>: cmp    x8, x10
[        ] Target 0: (Runner) stopped.
[   +1 ms] ios-deploy exited with code 0
[ +173 ms] Service protocol connection closed.
[        ] Lost connection to device.
[   +2 ms] DevFS: Deleting filesystem on the device
(file:///private/var/mobile/Containers/Data/Application/A0B6E002-D63F-479D-B7E6-14DDE3E1F4C2/tmp/myapp_appbgAt37/myapp_app/)
[ +254 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed
[   +9 ms] "flutter run" took 196,781ms.
[  +97 ms] ensureAnalyticsSent: 94ms
[   +2 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-IT)
    • Flutter version 2.8.1 at /Users/enrico/SDKs/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (3 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/enrico/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • 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.10+0-b96-7281165)

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (2 available)
    • iPhone di Enrico (mobile) • 00008020-001C14D20E88002E • ios            • iOS 15.2 19C56
    • Chrome (web)              • chrome                    • web-javascript • Google Chrome 97.0.4692.71

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->