NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: "adjusting" / control Swapping

On Thu, Sep 16, 2010 at 02:52:40PM +0100, Sad Clouds wrote:
> On Thursday 16 September 2010 14:41:11 Martin S. Weber wrote:
> > I.e. memory that got swapped out doesn't get returned to RAM when
> > the shortage on RAM is over. And that sucks. Hard.
> > 
> I think you misunderstand how swap works, i.e. it is designed to be like 
> that. 

Yes, and it could be designed to be wiser.

> If something gets pushed to swap, it stays there until the required pages are 
> referenced. Remember a running process is broken down into pages, only the 
> pages that are needed for execution are loaded into RAM, this is how virtual 
> memory subsystem works, [...]

And if you start getting pages back to RAM for an application you might
also want to look if there's enough space for getting ALL of its pages
back into RAM at once. And if so, do it. You know. You might argue due
to locality etc. blah blah that it's quite likely that you'll need more
of the program's pages in RAM soon. Probably without even updating their
timestamp of last use so that the pages that got transferred back to
RAM but were not touched are the first to go in a shortage situation

> be it NetBSD, Linux, or Solaris.

Sure, but in OS evolution there's always a point where a system does
something smart first and the others then adopt it. Let's teach 'em!



Home | Main Index | Thread Index | Old Index