Skip to content

Potential Memory Leak Issue #42

@djipco

Description

@djipco

First of all, thanks for your work on this plugin. 🙏🏻

Having said that, I think I have stumbled upon a memory leak problem. When I use data mode (on iOS), the page memory is always increasing (as seen in the Safari Web Inspector) and, eventually, the application crashes. To try and troubleshoot this problem, I installed the cordova-plugin-memory-warning-ios-android plugin and I do receive memorywarning events repeatedly until the crash.

To alleviate the problem, I tried calling frame.recycle() in the onAfterDraw callback but it does not change the situation. By the way, frame.image and frame.element both return undefined in my setup.

When I switch to file mode, I do receive the occasional memorywarning event but the page memory usually goes back down and it does not crash. However, file mode causes me another problem which I reported in #29.

Anyway, if it was possible to free a frame's memory when we are done with it, I would be a very hapy man. Thanks in advance for your help.

P.S. If it helps, here are the options I'm using:

{

    canvas: {
      width: 1136,
      height: 640
    },

    capture: {
      width: 1280,
      height: 2272
    },

    hasThumbnail: true,
    thumbnailRatio: 1/4,

    cameraFacing: "back",

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions