Memory Management in Objective-C


Q.34 Memory Management in Objective-C. Ans:

  • In Objective-C we having two type of memory management i.e Static Memory Management & Dynamic Memory Management
    1)Static Memory Management
  • When we are creating the memory of the time of compilation then it is called compile time memory management or static memory management.
    Generally in Objective-C, doesn’t require to go for Static Memory allocation.
    2)Dynamic Memory Allocation
  • When we are creating the memory at the time of execution then it’s called dynamic memory allocation.
    In Objective-C NSAutoReleasePool class is responsible for dynamic memory allocation.
    In Objective-C dynamic memory allocation will handle by reference counting mechanism.

Kalavati Technologies Pvt Ltd