Skip to content

Camera plugin causing memory leak on iOS #29586

@zbarbuto

Description

@zbarbuto

This is reproducible in the example project for the camera plugin.

Unsure whether or not this is directly related to #26007 or not

#20402 and #20943 were both closed without a resolution (I tried flutter upgrade as mentioned which did not fix the issue).

Steps to Reproduce

  1. Build the flutter code (flutter build package) and run on an iOS device through Xcode

  2. Go to the memory profiling section in Xcode:
    image

  3. Alternate between the two cameras at the bottom of the screen (front then back then front then back etc)

Result:
The memory usage will slowly climb with each alternation - it will spike for the back camera (likely due to the higher resolution) then drop down for the front camera but in either case the values that each settle on will get higher and higher until the app crashes with an out of memory error:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.p: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.perf: memoryPerformance issues related to memoryplatform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions