LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Swap and RAM ? (https://www.linuxquestions.org/questions/linux-general-1/swap-and-ram-30674/)

mikeshn 09-18-2002 08:32 PM

Swap and RAM ?
 
Hello

I have a question. I use Red Hat 7.3 ( Kernel2.4.18-10). In the table below it shows that the Mem free is (7220) and Swap Used is (11948). My question is why Kernel starts use the Swap when there still is free RAM memory?

[mike@localhost etc]$ free
total used free shared buffers cached
Mem: 255828 248608 7220 0 6736 111456
-/+ buffers/cache: 130416 125412
Swap: 521600 11948 509652

Thanks

gway 09-18-2002 09:33 PM

Hi,
its how the virtual memory algoritm works (how it is programmed). The idea is that you always leave a bit of free RAM for new programs, and that that swap you see there is for programs that are running but are not often used. So, why is there someting in swap? To get more free RAM for more active programs, linux puts unused programs in swap. Why is there a little unused RAM? To make place with new programs (else, it would have to first make room for them and then load them).

My english writing is pretty bad at this time of the night, hope it could be understand =)

-- Gway


All times are GMT -5. The time now is 07:00 AM.