View Single Post
  #6   Report Post  
Posted to uk.d-i-y
Tim Watts[_3_] Tim Watts[_3_] is offline
external usenet poster
 
Posts: 7,434
Default O/T: Ubuntu questions.

On 25/11/15 22:54, David Paste wrote:
Hello all.

I have recently installed Ubuntu 15.10 and after past failed
attempts at adopting Ubuntu, this time it is going very well (I'm
even considering buying an SSD for the machine).

I have some questions though:

In the System Monitor, under the Resources tab, the second
display down is "Memory and Swap History". I understand that
Memory is displaying the amount of RAM being used, but why does
it slowly increase when using Firefox? Even when just one tab is
open.

What is Swap?


Swapping (and Paging) is a method to free RAM but writing out idle
memory pages (blocks) to disk and leaving a pointer instead. Due to the
magic of virtual memory, the address map for that process's page that
got swapped out is made invalid. When the process tries to access that
page, the virtual address hardware in the CPU finds and invalid pointer
and faults to an interrupt hander. That handler looks up the page and
decides if it is a) actually invalid (the process then generally is
terminated) or if the page is actually on disk.

It retrieves the page from disk (and sometimes a few consecutive pages
for good luck), puts them into RAM and updates the process's virtual
address tables. The process is allowed to resume, retrying the failed
instruction, which now works.


Strictly, "paging" is the above and "swapping" is when the whole idle
process is written out to disk. But in practise the concept and effects
are much the same.

If you have boat loads of RAM you can not bother with a SWAP
partition/file. However SWAP is also used by Linux for hibernating (not
suspending, when the RAM is kept running but the CPU is stopped).

If you could reply in the simplest way possible, I'd be grateful!

Thanks in advance,

David Paste.