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

Peer Weidner commented on CB-7660:
----------------------------------

I can confirm this issue. Tried upgrading from Cordova 3.5.0 to 4.2.0. Didn't 
solve the problem. I've got round about 2000 files and 600 mb in total file 
size. 

org.apache.cordova.file-transfer 0.4.8
org.apache.cordova.file 1.3.2

Device runs iOS 8.1.2. iPad Air.

When downloading one file at a time the device stopped crashing, but 
requestFileSystem wont call back error or success. When storing the returned 
directory entry once, instead of every time a download is triggered, and 
calling FileTransfer(),download neither success nor error callback will be 
executed. 

Error always occurs after approximately 60% of files have been downloaded and 
is easily reproduced.

If downloads are started initially and handled simultaneously by the file 
plugin, the application will crash. 

While debugging I further more noticed that required processor percentage is 
over 100% when profiling the behaviour with instruments. I therefor tried 
adding a delay of 10 ms between file downloads. Reduced required CPU 
performance to 70-90% but did not help at all :)

Hope my comment helped shed some light on the issue. I just registered and am 
more than grateful for feedback on how to improve my bug report/comment.

> Cordova iOS File-Transfer download memory leaks
> -----------------------------------------------
>
>                 Key: CB-7660
>                 URL: https://issues.apache.org/jira/browse/CB-7660
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File Transfer
>    Affects Versions: 3.5.0
>         Environment: iOS 7.0.3 on iPad2 - Cordova 3.5
>            Reporter: Jordi Valls Carbonell
>            Assignee: Shazron Abdullah
>         Attachments: LargeFiles.png, SmallFiles.png
>
>
> File-Transfer memory leaks downloading files, no memory is released for each 
> file downloaded, finally i got "Memory Warning".
> To test add a button and call "testDownload" function every time console 
> confirmation message is displayed ("DOWNLOADED OK")
> {code}
> function win(entry)
> {
>     console.log("DOWNLOADED OK");
> }
> function fail(error)
> {
>     console.log("ERROR!");
>     console.log(error.code);
> }
> function testDownload
> {
> var url = 
> "http://upload.wikimedia.org/wikipedia/commons/5/5b/Ultraviolet_image_of_the_Cygnus_Loop_Nebula_crop.jpg";;
> var filename = "filename.jpg";
> var uri = encodeURI(url);
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
>        fileSystem.root.getFile(filename, {create: true, exclusive: false}, 
> function(fileEntry) {
>            var localPath = fileEntry.toURL();
>            var ft = new FileTransfer();
>            ft.download(uri,localPath,win,fail,false);
>        },function(error){console.log("errore 1: " + error.code);});
>     },function(error){console.log("errore 2: " + error.code);});
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to