开发者

iPhone - Memory allocation slightly increasing

I run my app in Instruments in order to look for the possible memory leaks. I currently don't have any leaks. However, I would like to have some help interpreting the memory allocation.开发者_如何学C When I'm in the first screen, let's say the memory allocation is 1.50 MB. When I navigate to the second screen the memory allocation is 1.80 MB. When I navigate back to the first screen, the memory allocation is 1.55 MB. Is it expected that when I navigate to the first screen, the memory is not as low as at the beginning?


Seeing memory usage increase like this is usually down to one of two things.

  1. Some objects are caching data in memory, to make it faster to reload if you access those resources again (images may do this)
  2. You have a memory leak

You can usually tell the difference between the two by doing the task a few times and seeing if the memory increases each time. So for example, if you go to your second screen and back 10 times and the memory allocation on the first screen increases each time, you probably have a leak.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜