Problems with memory management, autorelease, permanent heap is sometimes 250+ kb on iOS

前端 未结 2 1606
生来不讨喜
生来不讨喜 2021-01-25 08:03

I\'m really pulling my hair out on this one, it seems that I\'m having severe issues with memory management on an iOS app.

Here\'s the case: first I load table. When the

2条回答
  •  无人及你
    2021-01-25 08:27

    I think you might want to try to optimize your design first and read guides for efficent memory management. A better understaning of the components and the runtime helps more than tracking memory allocations and will make it easier to find the leaks.

    • First you should always use release. Only use autorelease when necessary.
    • Make sure you follow the guidelines for UITableView implementations and efficient management of UITableViewCells (lazy loading, cell reusing etc.).
    • Check if you have retain-cycles (retained view controllers won't be deallocated).
    • Track the deallocation of your view controllers and objects
    • Don't keep stuff in memory you don't need anymore.
    • Don't load stuff you don't need right now.

提交回复
热议问题