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

  • SEARCH
  • Home
  • 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 9135327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:48:35+00:00 2026-06-17T08:48:35+00:00

When I create a brand new Cocoa (Mac OS X) application using XCode 4.5,

  • 0

When I create a brand new Cocoa (Mac OS X) application using XCode 4.5, turning off “document based” options, and turning on “Automatic reference counting”, build, without changing anything, and run using the Profiler using the “Leaks” template, I see 19.76 megs of transitory memory usage, and 2.23 megabytes in “live bytes”, including 3132 CFStrings, 1371 CFBasicHash, and a few hundred odd mallocs(), including 192 kb still allocated by CoreGraphics even when the program has terminated. I see all this in the “Allocations” timeline, but no output in the “Leaks” timeline. I find this disparity confusing.

I would like to know, for example, with a simple Cocoa base reference application, if possible, and if not, then I would like to know what the reference technique is to know which leaks are mine, and which are expected.

Note that with a Foundation-framework linked command line tool, the number of “out of the box leaks” is much simpler, only about 18 mallocs(), totalling 1.06 kb, so it seems that AppKit (Cocoa) is the origin of most of the default “live objects still on the heap at the end of the program, that are somehow, not leaks”.

Is there some way to make a simple non-leaking Cocoa base reference application or does the framework itself leak so much (perhaps intentionally) that in fact, this is impossible?

Yes, I am aware of static analysis. Yes, I am aware of garbage collection. If someone wants to not use garbage collection, but only ARC, and wants to really see at runtime what has leaked, can that person do so, without having to ignore 14799 or so leaks in the foundation and frameworks?

Update: Source #1 of my own confusion is, as suggested, that I’m looking at the wrong timeline… However, in my own defense (or to explain my confusion), I have always considered any object which is still allocated on the heap at the end of program execution as a leak, a rule which is commonly observed in the Pascal (Delphi) and C++ world, and indeed on most non-garbage-collected languages on Linux and Windows. Maybe that’s not a “leak” in the Objective-C world at all? Is a “living item” in the memory timeline still “active on the heap”, and how is that different from a leak? The fact that my AppController is never told to “dealloc” was surprising to me too, but is “to be expected”, I’m told.

enter image description here

  • 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-06-17T08:48:35+00:00Added an answer on June 17, 2026 at 8:48 am

    Those look like objects that are “Created and still living.” These are NOT leaks, but simply objects that have not finished their life cycle. Since the application is still running, there will always be a set of objects that are still living, but still have pointers to them.

    A leak is an object that still lives, but has no pointers to it. Without a pointer, you cannot return that portion of memory to the OS.

    To see actual leaks, look at the Leaks timeline in the upper portion of Instruments. When a leak occurs, you will see a red bar in this timeline. Set the inspection range around this bar to view details about the leak below

    enter image description here

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

Sidebar

Related Questions

Why does NSColorPanel accumulate memory usage? Try it: Create a brand new cocoa-based application
I create a brand new Single View Application iPhone app in Xcode 4.2, it
If I create a brand new Website project using Visual Studio 2010 dot net
I am brand new to WIX and trying to create an MSI to install
I am brand new to Maven. How can I create the maven-archetype-nar-exec project type?
I'm brand new to GWT and am using the GWT Designer to help acclimate
This is quite a simple question. I can create a brand new FLA in
Does com.amazonaws.services.ec2 contain a method to create a brand new EC2 instance from an
Is there a process or solution template to create a brand new EWL project?
Im brand new to Android Application development and I am working on an application

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.