0

So I was profiling my app using Leaks and Allocation tool in Instruments. I started off by switching to the call tree for allocations and then the option choosen was for created and still living. I have a UIScrollView that loads a bunch of images. So I went ahead and tried scrolling down to the UIScrollView. All my code is using lazy loading and only load images that are on the screen, didn't load all at once and it tries to reuse as much as possible.

When I do this, it seems like the amount of memory used I a particular method, in this example imageForText is always going up. from the start of recording to time X it goes from 0 MB to 5 MB. So I then switch the toggle to create and destroyed and then back to create and still living and I can see there the memory is just 2-3 MB now. If I don't do this switching it seems that it will only just go up linearly.

Am I just mis-reading or not understanding this? Is this a bug on Instrument in such that the created& still living is not reflected properly, such that you have to toggle back and forth to get the most recently accurate data?

Here's my graph:

enter image description here

4

1 回答 1

0

Allocation Lifespan 单选按钮:All Objects Created、Created and Still Living 和 Created and Destroyed,影响调用树和对象列表的统计信息,您可以从跳转栏访问。单选按钮不影响图表的当前字节和分配工具显示的默认统计信息。

如果您只想专注于活动分配,请单击分配工具旁边的信息按钮。选中仅跟踪活动分配复选框。

于 2012-08-02T03:17:54.517 回答