Understanding the Instrument for memory leak checking - iPhone

前端 未结 5 1452
无人共我
无人共我 2021-02-03 14:57

\"alt

Above given images is of my application leaks.

Here I want to understand that, in Extended Det

5条回答
  •  温柔的废话
    2021-02-03 15:21

    The colors represent the different libraries the call stack is going through.

    The leak is caused by the frame in your code that made the allocation, even if the actual allocation is taking place deep within an OS library. Instruments is showing you exactly where the leaked memory was allocated. You'll have to figure out which line in your code resulted in the leaked allocation, which will be one of the frames in the stack on the right.

    The actual iPhone doesn't have much RAM available to your application. I tend to conservatively estimate about 25MB of RAM for my application to work with. Any leak, no matter how small, can sink the proverbial ship if the code is used enough.

提交回复
热议问题