Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 2020 19:15:42 +0100
From:      RW <>
Subject:   Re: Swapping when memory is idle??
Message-ID:  <>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, 20 Aug 2020 14:16:08 +0100
Steve O'Hara-Smith wrote:

> On Thu, 20 Aug 2020 10:53:27 +0300
> Odhiambo Washington <> wrote:
> > I have a machine with 16GB RAM and not heavily used.
> > I see from `top` some things that I do not understand well.
> > Why would a system use swap when memory is idle?  
> 	The system will push pages out to swap in response to memory
> pressure, trying to choose the pages least likely to be used soon.
> Once the memory pressure recovers there will be free memory again -
> and the pressure may only last a tiny amount of time. However once a
> page is pushed out to swap it will stay there until something tries
> to use it ...

Also it's not an either/or. Pages that are read back in don't free-up
swap space, instead they become "clean pages" which can reallocated

Writing to swap in the first place is mainly done to create clean
pages rather than free pages. 

Want to link to this message? Use this URL: <>