OBJECT-C Memory Management

Source: Internet
Author: User
OC Memory Management Method:
  1. ARC Auto Reference count memory management mode.
  2. Reference count (reference count): similar to C + + shared referent, C + + is understood, when an intrinsic is applied, it will record the number of times the memory is used. When the number of times is 0 o'clock, the application will be released internally.
    • Retain message: Make counter +1, change the method to return the object itself.
    • Release message: Makes the counter-1 (does not mean that the object is disposed).
    • Retaincount message: Gets the object's current reference counter value.
    • Memory management.
  3. GC (garbageconnection): Similar to Java, in the course of program execution, the program is accurate to the internal garbage collection mechanism (iOS does not support this way).
  4. Managed by the programmer, but C uses pointers to do these things, and of course, the scenario used is a high memory requirement. Because, OC supports mixed with C.

OBJECT-C Memory Management

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.