Repository: flutter
Issue: Unavailable image resources that have been evicted by `ImageCache` should be released in a timely manner
Labels: framework,f: routes,a: images,perf: memory,has reproducible steps,P2,found in release: 3.7,found in release: 3.10,team-framework,triaged-framework

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

When clicking the 'Open route' button to navigate to a new route, `ImageCache` removes the image due to triggering the cache limit. However, because the `_keepAliveHandles` count of the image is not zero, the unavailable image still occupies memory space until clicking the 'Go back!' button to return to the previous page and truly release its memory space.

1. Get test code: git clone git@github.com:0xZOne/image_cache_demo.git
2. Execute flutter run
3. Follow the steps in the video below ('Asset Image' -> 'Open route' -> 'Go back!')

https://user-images.githubusercontent.com/26625149/230573681-56d6e6c0-9178-4923-88cb-f539fb707028.MP4

### Expected results

If an image is removed from `ImageCache` and is no longer available, its occupied memory space should be released in a timely manner.

### Actual results

The previously decoded data is only released when the image is decoded again.

### Code sample

<details><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.1 22C65 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.7.12 on channel stable at /Users/zero/fvm/versions/3.7.12
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (9 days ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1
    • 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 33.0.2)
    • Android SDK at /Users/zero/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_SDK_ROOT = /Users/zero/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.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 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.76.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (3 available)
    • 艾尔玛的iPhone (2) (mobile) • 00008110-001635A42183801E • ios            • iOS 16.0 20A362
    • macOS (desktop)         • macos                     • darwin-x64     • macOS 13.1 22C65 darwin-x64
    • Chrome (web)            • chrome                    • web-javascript • Google Chrome 112.0.5615.137

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>