Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 249331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:25:06+00:00 2026-05-11T21:25:06+00:00

I am a new Objective-C programmer coming from a C#, VB.NET, Etc. These are

  • 0

I am a new Objective-C programmer coming from a C#, VB.NET, Etc. These are all garbage collected languages and for the most part the worst thing you can do is abuse memory usage, because when your program shuts down the memory is reclaimed by the runtime.

However, I am not clear about Objective-C. I get that for the most part its up to us as a developer to manage the allocation, initialization, retention and releasing of objects. I am trying my best to do this and think slowly I am getting the hang of it.

My worry is this: I am not sure if I understand the term memory leak correctly. Does this refer to not properly releasing memory, and then when my application shuts down there is unused dangling memory? IN other words, when my program shuts down the Mac OS doesnt make sure that everything the program was using is cleaned up?

I hope this make sense, its really making sense of the differences after a program shuts down, not so much about memory while the program is running.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:25:07+00:00Added an answer on May 11, 2026 at 9:25 pm

    I am not sure if I understand the term memory leak correctly. Does this refer to not properly releasing memory, and then when my application shuts down there is unused dangling memory?

    No; a memory leak is a leak of memory whilst the application is still running, since OS X reclaims all of the memory when the application terminates. If this was not so, it could cause huge problems because of poor coding and memory management, and would affect the entire system.

    It’s basically about retaining an object too much, or not releasing memory enough. For example, when adding objects to an array, this is a common way to go about doing it:

    NSMutableArray *array; //Pointer to some already allocated array
    
    [array addObject:someObject];
    [someObject release];
    

    Assuming someObject was allocated correctly, it will start with a retain count of 1. When you add objects to an array, the array calls retain on the object in question, bumping it up to, in this case, 2.

    When an array is released, it sends release to all of its objects; in this scenario, the retain count would be bumped back down to 1 (assuming no-one else had retained the object). This isn’t 0, so someObject would still be in existence. If someObject were a local pointer, created inside a method, and you no longer had a pointer to that object, then the memory would be hanging there. This is an example of a memory leak, and causes your application to use more memory than it needs, and will suffer until it is terminated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 365k
  • Answers 365k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Update: In order to make this example work, you have… May 14, 2026 at 3:51 pm
  • Editorial Team
    Editorial Team added an answer In principle the code looks OK -- I would put… May 14, 2026 at 3:51 pm
  • Editorial Team
    Editorial Team added an answer Ok, so it looks like the web service is doing… May 14, 2026 at 3:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.