Problem dealloc'ing memory used by UIImageViews with fairly large image in an UIScrollView

前端 未结 7 1881
遥遥无期
遥遥无期 2020-12-03 03:58

I have a large UIScrollView into which I\'m placing 3-4 rather large (320x1500 pixels or so) UIImageView image tiles. I\'m adding these UIImageViews to the scroll view insi

7条回答
  •  自闭症患者
    2020-12-03 04:35

    From what I learned on its memory management behavior is that views won't get dealloc unless low in memory. Try an official demo like SQLBooks: 1. Run with Leaks Monitor 2. Run through every views it has. 3. Go back to the root view. 4. You will notice the memory usage level is still the same. As Kendall said it may be cached?

    I think you shouldn't pay attention on this memory usage pattern -- because when the new images are pointed to the UIScrollView, the old image objects will be released and memory will be freed for new images anyway.

提交回复
热议问题