开发者

how to solve Instruments detected leaks whose responsible library is Apple's framework?

I'm checking memory leaks in my apps using Instruments Leaks tool.

After fixing all leaks whose responsible library is my app. I figure out that there still have a lot of leaks whose responsible libraries are iOS's framworks, based on what Instruments said?

This is a screenshot of Intruments:

how to solve Instruments detected leaks whose responsible library is Apple's framework?

I think these leaks may be caused by some of my 开发者_如何学运维misuse of frameworks' methods. What is your approach when getting leaks like these?

Thanks!


Well Apple Developers are also human, and they also can make mistakes. Alternative would be to create your own framework exactly same to that of Apple's but that will not be nice thing to do as Apple will certainly come up with upgrades and fixes in future that will resolve the issues.

The only solution would be to report bugs to Apple about memory leaks, even I have seen that framework has lots of memory leaks.

There are also other reasons for memory leaks, instruments may show memory leaks in apple's framework, but it is not necessary that it is caused by the framework's bad code, indeed it could be the bug in our code where we did not follow correct steps, for example we add observers but we do not remove them, we bind for events but we do not remove them, so if we have not done cleaning operations correctly, instruments may show leak but somewhere else.


I've been noticing the same with one of my apps and in the end, after trying to figure out what I am doing wrong, I came to the conclusion I'm doing nothing wrong and that Apple's frameworks have memory leaks as well.

So I don't think there's anything you can do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜