Forum Discussion

Hongbin L.'s avatar
Hongbin L.
New member | Level 1
10 years ago

Memory leak on iOS SDK 1.3.14

Dear Dropbox Developers,

I found a memory leak issue with the last Dropbox SDK on iOS with Xcode 6.4 running on iPhone4S. So far I confirmed that the memory leak occurs when files are uploaded.

To reproduce the issue, just use the sample project "DSRoulette". Create a button on the UI and link it to the following method.

- (IBAction)onClickButton:(id)sender {

    NSString *text = @"Hello world.";

    NSString *filename = @"working-draft.txt";

    NSString *localDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];

    NSString *localPath = [localDir stringByAppendingPathComponent:filename];

    [text writeToFile:localPath atomically:YES encoding:NSUTF8StringEncoding error:nil];

    

    // Upload file to Dropbox

    NSString *destDir = @"/log";

    [self.restClient uploadFile:filename toPath:destDir withParentRev:nil fromPath:localPath];

}

Launch the app and then monitor the memory usage on Xcode. Keep pressing the button for 20 times. You will see the memory usage does not increase for the first 10+ files upload. But then jump higher ~0.3 MB after ~15 files upload. If you continue pressing the button, the memory usage will continue to increase.

 

9 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Thanks for the report! We'll look into it.

  • Hongbin L.'s avatar
    Hongbin L.
    New member | Level 1
    10 years ago

    Hi Gregory. Thanks a lot for the response. Were you able to reproduce the issue as I described?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    We're still looking into it. To help us make sure we can or can't reproduce exactly what you're seeing though, can you share a screenshot showing the memory graph you're seeing? Also, you mentioned you saw this with Xcode 6.4 on iPhone 4S. Have you also seen this with other versions?

  • Hongbin L.'s avatar
    Hongbin L.
    New member | Level 1
    10 years ago

    I did not test on another device. iPhone4S is the only development device I have.

    Please see the attached picture.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Thanks! I'm not seeing that behavior though. What version of iOS is the device running?

  • Hongbin L.'s avatar
    Hongbin L.
    New member | Level 1
    10 years ago

    My iOS version is 8.1.

    I tried on two iPhone4S devices. Both devices are showing the same memory leak issue.

    I wonder what is the difference between your test setup and mine. Could you please share your code?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    I'm using the code you provided in your first post, in the DBRoulette sample app as you described. 

    Anyway, I've sent it along to the team to investigate.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    No, unfortunately I don't have an update on this.

About Dropbox API Support & Feedback

Node avatar for 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!