RAM Cache vs the Pageout Demon
RAM Cache vs the Pageout Demon
- Subject: RAM Cache vs the Pageout Demon
- From: Russ <email@hidden>
- Date: Fri, 20 Oct 2006 12:55:47 -0700 (PDT)
My commercial app has a ram cache system for image sequence playback; images
can be tens of megabytes and there can be gigabytes of them. On OS X, when the
RAM cache is large, it looks like the darwin pageout demon is activating
prematurely, paging out part of the RAM cache preemptively to meet its
free-space target, even though there is no competing demand. Consequently, the
app thrashes catastrophically to its knees.
The details of system activity seems to matter---I have two different possible
display paths (CG and GL), one of which transiently allocates and frees an
extra image buffer. The path that allocates/frees causes the machine to thrash
at RAM cache sizes that the other path is unaffected by, even though the total
consumption is about the same.
I need to better understand/control this issue and develop countermeasures.
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. I'm
investigating what the free-space target is (how it is set) and whether
it
might be changed. The thing I've found so far is VM_V_FREE_TARGET in
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/sysctlbyname.3.html
If there's a command-line version that might be used to examine/change these,
that would be nice to know.
The minimal fix is clearly to ratchet down the maximum permissible ram cache
size well under (50%?) the machine's actual physical size. Though this is
undesirable, it probably is better than letting the UI go unusable.
Or, can the task priority be raised---will that give my app priority competing
for free and inactive pages? 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.
I'm thinking that "wiring" 80% of the RAM into my app is unwise.
Other possibilities include some sort of RAM-tickling demon.
Suggestions welcome.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden