Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Memory Leak Issue #42

Open
djipco opened this issue Jun 6, 2024 · 1 comment
Open

Potential Memory Leak Issue #42

djipco opened this issue Jun 6, 2024 · 1 comment
Labels

Comments

@djipco
Copy link

djipco commented Jun 6, 2024

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",

}
@Sami-Radi
Copy link
Collaborator

Hi,

Thanks for the feedback.

Unfortunately i'am aware of this problem but i wasn't able to identify for sure the source of the memory leak.

Currently, the plugin is maintained at a minimum level. I integrate contributors pull requests as well as interesting modifications I observe on certain forks.

I do not plan to invest time in the plugin in its current form. At the moment, I am considering a complete rewrite using Capacitor, which better aligns with our current needs.

However, if I am able to provide a fix for this issue or if a contributor submits a pull request that satisfactorily addresses this problem, I will add it to the plugin.

Best Regards,

@Sami-Radi Sami-Radi added the bug label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants