On 12/01/2020 05:47, Carlos E. R. wrote:
On 12/01/2020 09.57, jdd@dodin.org wrote:
Le 11/01/2020 à 22:38, Carlos E. R. a écrit :
The processor can not use something that is in swap this moment; it has to copy it first to RAM.
So in a memory almost full situation the kernel first finds some block of memory that is not needed now (maybe by counting how long it has been since last used), writes it to swap, frees that block, then read from swap the block that it needs and writes it to the free ram.
It may not need to be written to swap. If this was a code page or a page from some other, similarly memory mapped file, the there is no need to write it to swap. If it is needed again it can be retrieved from the file system. Swap is only used for a program's volatile data.
So the operation is slow. The situation is called trashing; with a ^^^^^^^^ tHrashing rotating disk you hear it working and the system becomes slow.
Approximately. There may be details I do not consider but Andrei does :-)
Ideally, if I'm working with Thunderbird, and then go to the workspace where LibreOffice is open, Thunderbird would be sent to swap, and LO would be taken out of swap. But I doubt the kernel knows my intentions of using LO for a while and not Th.
Actually it makes some accurate prognostications. For a start, both make use of the same shared libraries. Not just libc but the GTK stuff as well. Both are heavy on startup, but the startup files and the startup code can then be discarded. Neither Thunderbird nor LO are 'sent to swap', only their volatile data. A lot of the difference between you TB volatile data and my TB volatile data lies in the details of configuration. Plugins contribute heavily!
Now, 5 gigs of ram + 5 gigs of swap approximates 10 gigs of memory. That imprecise saying is good enough for me :-)
This instant, my 8 GiB system is using 7.2 GiB of swap, but there are 3.1 GiB of ram available (between fully free (2.66) and buffers/cache (1.1)). But it is fresh out of hibernation, the proportion of swap is higher.
Unlike older models, that 'buffer/cache' is just an expression of where some of the dynamics of virtual memory is at at the moment. - a disk-less workstation that runs entirely off networking will have a very different view of the buffer/cache! - a CPU compute intensive application (think: mining bitcoins?) is going to have a very different profile - a 'headless' server, one not running X or the associated interactive applications (TB, FF, LO DT) and graphics will use network IO buffer heavily. A simplistic memory report (perhaps to a ssh login) is going to give inadequate information about what buffers are being used. For some of the above ... why would you cache a buffer? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org