Why the operating system uses SWAP when it still has RAM

Asked

Viewed 212 times

4

I learned that virtual memory (SWAP) was only used when RAM had reached its maximum capacity (or almost). But, I realize that it is not so, according to this image I took of the performance of my computer:

Desempenho do Sistema

Why does this happen? Am I not wasting my RAM (8GB)? What advantage does the computer have to use the virtual before filling all the physics?

1 answer

0

Each operating system has its strategy to use swap. If you do have leftover memory, your system is probably writing parts of the memory into the swap even without needing to. If there is an urgent need for memory, be quick to release this memory as it is already "Swapped".

RAM consumption will always tend to 100% even with light load because the system takes advantage of the leftover for caching files.

15 or 20 years ago the operating systems were still hitting the hand with these things, and it could happen that a system would be slower with swap than without, with spare memory. There were the tricks of using swap the size of RAM, swap with double RAM, etc. Nowadays it is no longer relevant.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.