Skip to content

Memory leak while playing videos and images simulatneosly #371

Description

@satheeshps

I tried playing videos one after another in fullscreen, continuously for couple of days and its working fine as expected. Similarly, i tried the same for the images and they worked fine as well. But when I tried playing videos one after another in one region of the ui and the images similarly in 2 other regions together, I am seeing a memory leak issue. After couple of days the app crashes, since the memory, the app is holding is growing and it isnt reducing. When I ran the app I swa 7GB of memory being held by it and its all in RSS memory region. I tried it out in windows and android, and it crashes in both the cases.

I am also calling PaintingBinding.instance.imageCache.clear(), PaintingBinding.instance.imageCache.clearLiveImages(); at certain intervals. The VideoPlayer is wrapped in AspecRatio widget which is wrapped in RepaintBoundary and RepaintBoundary is also used for ResizeImage widget

Could you please suggest a solution for this scenario

FLUTTER DOCTOR REPORT
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.44.0, on Microsoft Windows [Version 10.0.26200.8737], locale en-IN)
[√] Windows Version (Windows 11 or higher, 25H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
X cmdline-tools component is missing.
Try installing or updating Android Studio.
Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.22 (December 2025))
[√] Connected device (3 available)
[√] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions