iOS Memory Management Personal Summary

Source: Internet
Author: User

One, the variable, the essence represents a piece of memory that can be manipulated, she uses the way is the memory symbolic + data type

1. Save the variable with three zones:

1 "Static storage area

2 "Stack

3 "Heap

2. The variable is also based on the position of the declaration of two types of salutation:

1 "Global variables

2 "Local Variables

3. Three storage areas store that variable separately

1 Static Storage-initializes when the allocation space is compiled and exists when the program runs

Global variables, static local variables

2 "Stack

The stack holds a local variable (which is a variable that refers to a variable or editor that is responsible for automatically releasing it, for example: Int,long,double basic type, they are not dynamically created, so they are stored in the stack, have the scope of the feature)

3 "Heap

Heap management relies on the runtime environment, C uses malloc,c++ using New,o-c alloc, etc.;

Simply put, the memory accessed through the pointer (*point), need to be freed, take O-c object example: NSString of an object, dynamic method [[NSString alloc] init] When the heap will create a piece of memory, you need to manage her, that is, free () she , this is iOS memory management, they do not have the scope of the features.

Second, iOS memory management

iOS Memory Management Personal Summary

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.