Start a new topic

Query Completion Block Memory Leak

Hi,



I have a similar problem to the one posted here: https://support.kinvey.com/discussion/200929117/completion-blocks-seem-getting-leaked



I have an app that runs a query every 60 seconds or so, and it seems to be leaking memory each time it’s run, even if the completion block isn’t doing anything.



I put some of the code in to a simplified gist here: https://gist.github.com/adammulligan/68a08f80d73b70b1c04e It’s not everything that makes it functional, but shows the important parts I think.



According to some quick Instruments.app inspections, it looks like the two main culprits of unreleased memory are:



* `-[NSPlaceholderString initWithBytes:length:encoding:]`

* `-[KCS_SBJsonStreamParserAdapter parser:found:]`





I’d appreciate any insight as to what’s going on here!



Thanks!

Adam

Hey Adam, Thanks for reporting this, and for the gist. We're digging into it and we'll most likely follow up with questions.
Hi Caroline - did you get any further digging into this? I'm waiting on the same issue. Thanks
Hi Jonathan,



How are you determining that these are leaks? I was unable to reproduce using the gist.
Hi Mike, thanks for taking a look. We used the "Leaks" template in XCode's Instruments.

For the time being it's no longer an issue: we cleaned and recompiled the app, reduced the frequency of re-querying, and disabled some features.
Login or Signup to post a comment