• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: weird memory issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weird memory issue


  • Subject: Re: weird memory issue
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 22 Jul 2008 20:23:28 -0500

On Jul 22, 2008, at 8:04 PM, Martin Redington wrote:

The memory which appears to have been released in the heap output is
about the right size, but AM and BigTop report this memory as still
being consumed.

Which tool should I believe?

You should believe all of them, but you should understand what it is that they are telling you.


A typical malloc implementation does not return memory to the OS when it is freed. It keeps it for itself to use to fulfill subsequent allocation requests. Therefore, it is not expected that freeing the memory would necessarily reduce the OS's notion of the process's VSIZE, for instance. However, you don't really care what a process's VSIZE is because the VM system will page out unused pages as necessary. That is, memory which has been freed by the malloc implementation but not returned to the OS (as by vm_deallocate) does not have much cost to the performance of the system.

Thinking about this another way, it is your responsibility to free any memory that you request when you're done with it. It is not your responsibility to worry about what the frameworks/libraries do after that.

Cheers,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: weird memory issue
      • From: "Martin Redington" <email@hidden>
References: 
 >weird memory issue (From: "Martin Redington" <email@hidden>)

  • Prev by Date: Re: Changing __MyCompanyName__ in existing Nib/Xcode project?
  • Next by Date: Re: Problems with Info.plist and 3.1
  • Previous by thread: weird memory issue
  • Next by thread: Re: weird memory issue
  • Index(es):
    • Date
    • Thread