We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
James Z.3
10 years agoNew member | Level 1
[Swifty] File download memory management
I noticed that for every GB I download to local file system via client.files.download, the app's memory usage increase by that amount. I imagine the Dropbox client doesn't keep the file in memory af...
sigrem
10 years agoNew member | Level 1
Hi, We are seeing a similar issue when downloading files from Dropbox using Swifty Dropbox. The memory usage increases gradually to almost 2/3 of the file size by around 1 MB/sec. For example for a file of size 320 MB the memory usage goes from 40 MB (when download started) to 240 MB and stays there until the download is finished:
let destination : (NSURL, NSHTTPURLResponse) -> NSURL = { temporaryURL, response in
let localUrl = NSURL(fileURLWithPath: self.localPath)
return localUrl
}
if let client = Dropbox.authorizedClient {
client.files.download(path: dbPath, destination: destination).response
{
response, error in
if let (metadata, url) = response {
if error != nil {
NSlog("Dropbox download failed. \(error!.description)", .Error)
}
else {
NSlog("Dropbox file downloaded.")
}
}
}
}
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!