Re: Losing my memory - a caching problem?
Re: Losing my memory - a caching problem?
- Subject: Re: Losing my memory - a caching problem?
- From: Stuart Rogers <email@hidden>
- Date: Wed, 18 Aug 2010 11:45:56 +0100
On 18 Aug 2010, at 01:31, Ken Thomases wrote:
> On Aug 17, 2010, at 7:26 PM, Shawn Erickson wrote:
>
>> When you say "free" I assume you mean the "free:" number listed in
>> activity viewer for the system as a whole?
>
>> If so then what you are seeing is an expected result of the "unified
>> buffer cache" maintained by the system (since you say private memory
>> of your application doesn't increase). In a nut shell unused RAM is
>> wasted RAM so the system always attempts to cache once used pages of
>> memory (for example file data loaded by your application) as long as
>> possible until they need to be reused for active / new allocations.
>
> In an even smaller nutshell: you should consider Inactive as equivalent to Free in Activity Monitor's System Memory tab.
I quite understand this, but the practice doesn't quite fit the theory.
If 'inactive' is effectively available as 'free' for all apps, then it should be
available to my app. And yet, when 'free' drops to just a few megabytes
I see extra swap files being created despite there being several gigabytes
available as 'inactive', which suggests to me that the unified buffer caching
is too aggressive - the cache is being maintained at the expense of swap
files.
Now, one or two swap files on this machine (an i7 iMac) isn't the end
of the world - I don't really notice any system sluggishness until I get
more than three swap files. But as the target for this software will likely
be a low end Mac, this is a concern - on my 2GB Core Duo MBP this
code will kick off so many swap files the machine becomes barely useable.
Stuart
_______________________________________________
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