Re: Reload VM hint?
Re: Reload VM hint?
- Subject: Re: Reload VM hint?
- From: Michael Smith <email@hidden>
- Date: Wed, 30 May 2007 12:36:34 -0700
On May 30, 2007, at 7:47 AM, James Bucanek wrote:
I'm hoping this is the correct list. It sounds like a Kernel issue.
Feel free to enlighten me if it's not.
I'm looking for a way to reload pages that have been paged out by
another process.
They scenario is pretty simple: I've written an application that
uses a lot (100s of MB) of RAM. Users run the application (it's a
backup utility). Applications does its thing and terminates. Users
now complain that their system is "sluggish and unresponsive."
The problem, obviously, is that as the application ran it forced
just about everything else in RAM to be paged out to the VM backing
files. The OS then spends the next 30 seconds, or more, paging it
back in -- a period of time my users describe as "eternity."
Is there anyway for my application to send a "hint" or command to
the VM manager that will cause it to reload the recently paged out
memory pages? I have a supervisory process (a scheduler daemon)
that can do this after the process terminates.
No, there isn't. The system has no way of telling the difference
between pages that were evicted but still relevant and pages that
were evicted and not relevant; it has to wait for other applications
to need them.
Brian's somewhat terse observation might bear a little expansion,
though I think he may be on the right path.
You say your application is a backup utility, and that it uses
hundreds of megabytes of RAM. What do you mean by "uses"? Do you
make large allocations inside your application's address space?
Why? If you are buffering for a device, you can probably get by with
much less buffer than you think; certainly not hundreds of megabytes.
As a backup utility, you are probably reading a lot of files; as
Brian notes if you apply the F_NOCACHE fcntl to these files
immediately after opening them, you will avoid evicting other
applications' pages in favour of file cache pages. You should only
do this for files you are only reading once; if you read a file more
than once in a relatively short period of time, or you write it with
the intention of it being read shortly thereafter you're better of
letting the system cache it.
HTH; feel free to ask more questions. Your users, incidentally,
should buy more RAM. 8)
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden