Performance Optimization Instruments-leaks tool use

Source: Internet
Author: User

Performance optimization uses the instruments leaks tool to detect memory leaks.

Memory leaks, that is, after the memory is allocated and used, even if the memory is no longer in use, has not been released, resulting in the use of other objects can not be used.

In Arc memory management mode, the resulting memory leaks are as follows:

(1) animation effect generated by the infinite loop

(2) Strong references between multiple objects

(3) The use of timer Nstimer

(4) Strong references to code block blocks

Workaround:

(1) When the view controller is about to disappear, remove the animation effects;

(2) using weak reference between objects;

(3) Stop timing effects When the view controller is about to disappear;

(4) using weak references in the code block;


Find the leaks tool in instruments

Method 1:


Method 2:


Use






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.