A question about virtual memory.

Liam Proven lproven at gmail.com
Mon Nov 9 12:27:16 UTC 2020


On Mon, 9 Nov 2020 at 13:20, Owen Thomas <owen.paul.thomas at gmail.com> wrote:
>
> A recent post relating to this topic has prompted me to ask this question.
>
> Looking at the System Monitor, I see that virtual memory begins to fill when physical memory is near its maximum. However, when physical memory usage drops, I do not see a drop in virtual memory with a corresponding rise in physical memory - it seems that data in virtual memory remains there at least until it is needed. Sometimes it seems that I can have much more free space in physical memory than I have data in virtual memory.
>
> Why isn't virtual memory transferred to physical memory as soon as or perhaps not long after the space becomes available? How might I instruct my computer to behave as I might expect? Indeed, am I expecting too much of the wrong thing?

Why would you want your computer to waste time fetching stuff back
into RAM that you haven't used?

Stuff is swapped out when it hasn't been used for a while.

https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

If you don't use it, then it stays swapped out. If you use it, it's
brought back.

The OS tries to keep the disk cache big so that if you want something
new, it'll load quicker.


-- 
Liam Proven – Profile: https://about.me/liamproven
Email: lproven at cix.co.uk – gMail/gTalk/gHangouts: lproven at gmail.com
Twitter/Facebook/LinkedIn/Flickr: lproven – Skype: liamproven
UK: +44 7939-087884 – ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053




More information about the ubuntu-users mailing list