cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lasse (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-11784) Memory leak on iOS when opening and closing camera
Date Tue, 04 Apr 2017 08:32:41 GMT

    [ https://issues.apache.org/jira/browse/CB-11784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15954803#comment-15954803
] 

Lasse edited comment on CB-11784 at 4/4/17 8:31 AM:
----------------------------------------------------

I am not running in to the exact same issue (although I haven't tried opening and canceling
the camera hundreds of times in a row), but I think it is a similar issue.

The app is crashing after taking tens of photos in a row, so the crash is similar to this
https://issues.apache.org/jira/browse/CB-10988, but when debugging with XCode I can see that
the crash is probably related to the same as in this issue:

bq. the memory allocated under 'Other Resources' grows without ever being cleaned up

I can reproduce the issue currently with iPad Air A1475 + iOS 10.3 beta (10.3.1 and 10.3.2)
+ Cordova 6.5.0 + cordova-plugin-camera 2.4.0 by:

1. Opening a HelloCordova app
2. Running navigator.camera.getPicture(function() {}, function () {}, {})
3. Taking the photo and approving the photo

Then repeating 2. and  3. until the app crashes, which on that device is very reliably around
40 photos. The Cordova app is not continuously reserving more memory, but the "Other processes"
are.

I could not reproduce the issue in the same way on iPad 4th gen A1460 + iOS 10.2.1. It seems
the "Other resources" are freed faster and I didn't keep on clicking new photos for ever (I
tried maybe 80-100 photos successively).

[~modohash] Do you have your own camera plugin on Github or somewhere, so I could test it
out?


was (Author: lasse):
I am not running in to the exact same issue (although I haven't tried opening and canceling
the camera hundreds of times in a row), but I think it is a similar issue.

The app is crashing after taking tens of photos in a row, so the crash is similar to this
https://issues.apache.org/jira/browse/CB-10988, but when debugging with XCode I can see that
the crash is probably related to the same as in this issue:

bq. the memory allocated under 'Other Resources' grows without ever being cleaned up

I can reproduce the issue currently with iPad Air A1475 + iOS 10.3 beta (10.3.1 and 10.3.2)
+ Cordova 6.5.0 + cordova-plugin-camera 2.4.0 by:

1. Opening a Cordova HelloWorld app
2. Running navigator.camera.getPicture(function() {}, function () {}, {})
3. Taking the photo and approving the photo

Then repeating 2. and  3. until the app crashes, which on that device is very reliably around
40 photos. The Cordova app is not continuously reserving more memory, but the "Other processes"
are.

I could not reproduce the issue in the same way on iPad 4th gen A1460 + iOS 10.2.1. It seems
the "Other resources" are freed faster and I didn't keep on clicking new photos for ever (I
tried maybe 80-100 photos successively).

[~modohash] Do you have your own camera plugin on Github or somewhere, so I could test it
out?

> Memory leak on iOS when opening and closing camera
> --------------------------------------------------
>
>                 Key: CB-11784
>                 URL: https://issues.apache.org/jira/browse/CB-11784
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Camera
>    Affects Versions: 2.2.0
>         Environment: Cordova CLI version 6.3.0
> cordova-plugin-camera 2.2.0
> cordova-ios 4.2.0
> iOS 9.3.5
> iPad Mini 1
>            Reporter: Christopher McCabe
>
> When opening and closing the camera plugin without taking an image, the memory allocated
under 'Other Resources' grows without ever being cleaned up.
> Testing on an iPad mini 1, when I open and close the camera plugin without taking a picture
I can crash the app. This usually takes about 130-150 times opening and closing the camera
to cause a crash. The leak is present on newer devices but the app is harder to crash due
to the much larger device memory.
> Steps to reproduce:
> 1. create an app with the camera plugin
> 2. run the app on an iPad mini 1
> 3. open the camera plugin to take a picture, not from the gallery
> 4. click cancel
> 5. repeat 3 + 4 until the app crashes
> It appears that Jetsam kills the app for not being a good memory citizen.
> EDIT: I've tested this further and it appears on my iPad mini 3 as well although it's
harder to trigger. I've included a sample app that can be used to view the problem
> https://github.com/modohash/cordova-camera-leak
> By clicking the 'trigger camera' button and then clicking cancel and repeating the process
you can see that while the app memory usage stays steady, the other processes accumulate memory.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message