Re: weird memory issue
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