IOS distribution - a constant number in coachmen is not always 0

When profiling my iOS application, I perform a simple task several times, when I click and pop out the view from the stack, and then take a picture. The same code is executed every time, and the pushed view simply contains some images that are deleted as soon as the pop-up view appears.

screenshot of instruments

Now, since the constant counter is 0 for almost half the heap, is it possible to assume that there is no memory left?

I heard that lines with a constant counter greater than zero may be due to some internal caching.

I am using Xcode 4.2.1 and the application is using ARC.

Edit:

Thanks to the Kendall Helmstetter Gelner, I was able to debug this problem further. I probably shouldn't have used a simulator to debug this. I now ran it on the device, and now it looks like there is one object that is not freed up:

Heapshots of app running on device

After looking at the extended detailed view, I think I just found the cause of the problem.

+6
source share
1 answer

It’s hard to say from the whole screen what can be cached or not - UIImage will cache things, perhaps some other elements of the system. It looks like you can run this in a simulator, have you tried using heaps on the device?

You can also select "Hide system libraries" to the side and get an idea of ​​how much of your own code is involved.

+2
source

Source: https://habr.com/ru/post/907543/


All Articles