[ https://issues.apache.org/jira/browse/CB-2787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13819192#comment-13819192 ]
Cho commented on CB-2787: ------------------------- Hi, var ft = new FileTransfer(); ft.download(sorceURI, targetURI, function(entry) { //call your own function. // the magic line entry = null; } ); Not sure how much I can help but basically it is at javascript level that I am setting it to null. Not sure how doesn't all this related way back to JAVA though. The problem is re-occur after the new plugin adopt mentioned by Gregor Gabriel? For mine, I didn't adopt the new plugin provided. I can't guarantee but most likely I am downloading from https as well and didn't hit any problem. > PhoneGap FileTransfer.Download more than 300 files > -------------------------------------------------- > > Key: CB-2787 > URL: https://issues.apache.org/jira/browse/CB-2787 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer > Affects Versions: 2.5.0 > Reporter: Cho > Assignee: Ian Clelland > > I had tried to download more than 300 files and then it hit error after that. > Seems like some IO Connection was not properly closed. I wrote a small code > to test it out. > Any idea? How to file a report or get a source of phonegap to check the real > cause? > {code} > var counter = 500; > function DownloadFile() { > if (counter == 0) { > DownloadComplete(); > return; > } > var ft = new FileTransfer(); > var downloadUrl = "<source>"; > var dlPath = "<target>" > ft.download(downloadUrl, dlPath, function(entry) { > counter--; > UpdateProgress(); > DownloadFile(); > }, function(error) { > DownloadFailed(); > }, true); > } > {code} > note: <target> and <source> is alright because it was it failed when the > counter goes until 300+. > {code} > 03-14 08:35:09.706: E/FileTransfer(24867): > {"target":"<target>","source":"<source>","http_status":200,"code":1} > 03-14 08:35:09.706: E/FileTransfer(24867): java.io.FileNotFoundException: > <source>: open failed: EMFILE (Too many open files) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.IoBridge.open(IoBridge.java:416) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.io.FileOutputStream.<init>(FileOutputStream.java:88) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.io.FileOutputStream.<init>(FileOutputStream.java:73) > 03-14 08:35:09.706: E/FileTransfer(24867): at > org.apache.cordova.FileTransfer$4.run(FileTransfer.java:685) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.lang.Thread.run(Thread.java:856) > 03-14 08:35:09.706: E/FileTransfer(24867): Caused by: > libcore.io.ErrnoException: open failed: EMFILE (Too many open files) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.Posix.open(Native Method) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.IoBridge.open(IoBridge.java:400) > 03-14 08:35:09.706: E/FileTransfer(24867): ... 6 more > {code} -- This message was sent by Atlassian JIRA (v6.1#6144)