Re: Losing my memory - a caching problem?
Re: Losing my memory - a caching problem?
- Subject: Re: Losing my memory - a caching problem?
- From: Michael Ash <email@hidden>
- Date: Wed, 18 Aug 2010 12:10:13 -0400
On Wed, Aug 18, 2010 at 6:45 AM, Stuart Rogers <email@hidden> wrote:
> 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.
Number of swap files is completely irrelevant. It's the amount of
swapping activity which matters to performance.
If the memory is truly inactive, then it needs to be saved, but isn't
being accessed anytime soon. Thus, it must get swapped to disk to make
room for new stuff, but once it is, it won't be swapped back in, so it
won't hurt performance. You could swap 60GB of inactive stuff to disk
and not incur any real penalty.
On the other hand, if you start swapping active memory, even 1MB of it
will completely destroy performance if your working set exceeds your
RAM.
Swap file creation is not a good metric for performance.
Mike
_______________________________________________
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