Re: Should VM shrink to original when releasing huge memory
Re: Should VM shrink to original when releasing huge memory
- Subject: Re: Should VM shrink to original when releasing huge memory
- From: Clark Cox <email@hidden>
- Date: Tue, 13 Oct 2009 07:26:23 -0700
On Tue, Oct 13, 2009 at 2:14 AM, Nick Rogers <email@hidden> wrote:
> Hi,
> I'm using Snow Leopard and Xcode 3.2.
> When my program runs the VM grows from 50MB to around 550MB.
> So when I release the memory, should VM shrink to the original 50MB, in this
> case it isn't so?
No, in most cases, it won't shrink. Most of the time, when you free
memory, it is returned to a pool within your application for use in
future allocations, but not returned to the OS (so it remains mapped
into your application's VM space).
If, whatever you're doing with that memory is repeatable, and the
memory continues to grow significantly each time you repeat, then you
may have a leak, otherwise, it's just business as usual and nothing to
worry about.
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden