Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 1057  / 2 Years ago, sun, july 3, 2022, 1:47:21

When I use a lot of RAM (90-100%) then the laptop normally starts using SWAP so if I look in htop during that intense usage I see it's using 200MB of SWAP. But when I stop using the laptop (the computer is idle and running) the SWAP is still used, it's not cleared as the RAM is.



Why is that?




  • System: Ubuntu 11.04 64-bit

  • Laptop: Asus 1201n 2GiB RAM, 2GiB SWAP, 1.6 ghz dual core cpu.


More From » 11.04

 Answers
3

The swap space will not move the swapped out pages back into the physical RAM until the processes that are using that memory access it again. So, especially if you are letting the computer idle, you will most likely never see all the swap emptied.
There are two ways to clear the swap:




  1. Disable swap. During this process, the pages will be flushed back to
    RAM. Then you can re-enable it.

  2. Force every idle process to actively make use of whatever was swapped out.



Number 2 is nearly impossible, and number one is unnecessary. So, since whatever was swapped out is not even trying to use whatever is stored in that memory, I would not worry about having some swap usage - it is completely normal and will not affect your performance since the swap is not being actively "used".


[#41333] Sunday, July 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enytidge

Total Points: 169
Total Questions: 105
Total Answers: 107

Location: Papua New Guinea
Member since Tue, Aug 24, 2021
3 Years ago
enytidge questions
Tue, Feb 28, 23, 15:26, 1 Year ago
Sun, Jan 1, 23, 19:36, 1 Year ago
Sun, Oct 24, 21, 07:30, 3 Years ago
Wed, Nov 9, 22, 22:02, 2 Years ago
;