FileProvider icon indicating copy to clipboard operation
FileProvider copied to clipboard

Memory usage for FTPFileProvider seems very high

Open pansophy opened this issue 6 years ago • 5 comments

I'm looking for an FTP solution for iOS, and FTPFileProvider seems like the way to go, but, in my testing, it appears as if the entire file is loaded into memory, which won't work for my particular case. Is this true? If so, is there a way to reduce the memory footprint and have downloads go to a file directly?

Perhaps this is also the reason that the Progress delegate only gets called once the file download has completed, too, and that the Progress information does not have the total unit count (expected size).

pansophy avatar Dec 07 '18 15:12 pansophy

Use copyItem(localFile:, to:) and copyItem(path:, toLocalURL:) functions in order to not load contents into memory.

amosavian avatar Dec 07 '18 18:12 amosavian

I'm using copyItem(path:toLocalURL) for the downloads.

pansophy avatar Dec 07 '18 20:12 pansophy

I am using copyItem(path:, toLocalURL:) and the memory size seems to grow as the file is read from the remote server. The FTPStreamTask seems to append incoming data to the "dataReceived" object, and that is consuming the memory.

pansophy avatar Dec 11 '18 00:12 pansophy

This also seems to happen when uploading a file to a FTP server when using copyItem(localFile:, to:). Is there any way around NOT loading the whole file intro RAM?

adrianilie9 avatar Nov 11 '19 14:11 adrianilie9

Any update on this? @pansophy @adrianilie9 @amosavian

nastasiupta avatar Mar 24 '23 11:03 nastasiupta