| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
--- Michael Smith <email@hidden> wrote:
I think OS X's preemptive pageout to maintain minimum free list (see http://developer.apple.com/documentation/Performance/Conceptual/ ManagingMemory/Articles/AboutMemory.html) is counterproductive, vs waiting for actual free-space demand.
You do, eh? Well, let's assume just for the moment that the kernel needs those free pages in order to make forward progress when an application like yours thinks it needs every last page in the system.
Untouched pages can be reclaimed at any time by the operating system without
penalty. Doing so before necessary causes an avoidable performance loss.
If people are running my app on a 2 GB machine, try telling them they can only
cache 1 GB because there are 50 background processes they've never heard of
that need RAM too. If people buy a 2 GB machine, they expect to be able to use
most of it, regardless of the details.
you can more realistically assess the amount of free memory required to display an image before bringing it into your cache, and thus whether the sum of cached images poses a threat to your working set.
I already have code that can reduce RAM cache if memory gets low. Can you
suggest a precise predictive criteria for doing this? If the RAM cache is
reduced programatically, the user can see what's happening and the machine
stays interactive. If it starts thrashing, UI response goes down the tubes.
I could probably find out the minimum and current free list sizes, but that is
unduly conservative if more memory can be wrung out of other processes.
Even if OS X wants to grab some pages to maintain its free list, I need it to grab them from inactive processes, not the ones it thinks are inactive in my app.
If those tasks are truly more inactive than you, you will already have stolen all the pages from them that you can.
Part of the problem is that if you are playing through 10 or 20 seconds of
imagery, you don't get around to it very often, but when you do, you still want
it there.
What is the actual selection algorithm for pages to be paged out? A strict LRU, or are there qualifiers based on process, priority, etc?
The bottom line to all of this is that first you must understand what your application is doing.
Don't worry, I've been studying it for several years now. Its performance is
widely praised on WinXP, but lags in this area on OS X, something I'm working
to rectify. I need to understand what OS X is doing to help.
= Mike
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden
| References: | |
| >Re: RAM Cache vs the Pageout Demon (From: Russ <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.