You are not logged in.

#1 2007-09-18 13:27:05

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Swap not used and RAM not emptied

Latest Arch Linux kernel, KDE, exactly 2.0 GB swap parition, 2 GB RAM. 

I have never seen my swap in use whatsoever.  Even with tons of applications and files open, Ksysguard says swap is always 100% free.  Why?  I have not messed with the swap partition at all.  I created it with Parted Magic under the "linuxswap" filesystem and then when I installed Arch I mounted it as swap and allowed it to format the partition.  Why is it never used? 

The RAM is used by the system perfectly except that nothing seems to clear out of the RAM, even after it is no longer used.  I especially notice this when I am moving large files.  The RAM fills up to 1975/2015 and stays there.  The files transfer at full speed, but then even after the transfer is done the RAM stays at 1975/2015 and I can not flush it unless I reboot the computer.  Why?  Does anyone know of a program I could use that will allow me to clean the RAM of unused programs?

Offline

#2 2007-09-18 13:33:37

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Swap not used and RAM not emptied

When the ram is used at 1975, what happens when launching memory hungry apps ?
Eg try running openoffice or firefox or tomboy or whatever, and check new ram / swap usage.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#3 2007-09-18 14:51:47

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Swap not used and RAM not emptied

Linux tries to use as much memory as possible for caches. Free memory is wasted memory.

Run "free -m". "-/+ buffers/cache" shows memory used only by applications. If you really want to drop all caches, e.g. for testing purposes, you can run "sync; echo 3 >> /proc/sys/vm/drop_caches".

You apparently have enough RAM for swap not to get filled under normal workloads.

Last edited by lucke (2007-09-18 14:53:15)

Offline

#4 2007-09-18 15:00:40

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Swap not used and RAM not emptied

lucke wrote:

You apparently have enough RAM for swap not to get filled under normal workloads.

Exactly - 2GB is more than enough for normal computer use in linux.  If you want to be able to trace memory use better install an app like htop, it'll show you exactly how much _resident_ memory programs you run (and your system as a whole) use.

Offline

#5 2007-09-18 15:04:54

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Swap not used and RAM not emptied

I can look at the exact numbers when I get home, but I am pretty sure that when the memory is stuck at 1975/2015 and I open a memory-hungry application the numbers do not budge and the application opens very slowly.  Anything I try to do once the memory is at 1975/2015 happens very slowly.  I usually just have enough patience to press Ctrl + Alt + Delete to restart. 

I might try taking out three of my four RAM chips to bring my system down to 512MB of RAM.  Then I will run as many programs as possible and open as many files as possible to see if the swap is ever used.

Last edited by Kienja Kenobi (2007-09-18 15:06:13)

Offline

#6 2007-09-18 15:49:44

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Swap not used and RAM not emptied

2 GB swap is a bit of a waste of HD space. Years ago one could recommend doubling the swap space compared to his RAM (i.e. 512 MB swap or more for 256 MB RAM). More than 1 GB swap is not recommended nowadays.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2007-09-22 13:33:51

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Swap not used and RAM not emptied

Your were right.  My swap was not being used because I have enough RAM for everything without it.  I was running Compiz-Fusion and tons of programs and I noticed my swap was 98% free, so it is working, it is just not needed most of the time. 

I was also wrong to say that my RAM was never emptying out.  If I watch the RAM as I am working with normal programs, the amount of used RAM always decreases every time I close a program, which is what should happen.  The only time I notice the RAM fill up and stay there is when I am transferring gigabytes of data, but I have not done this for a while.  The next time I do something like that I will wait a while after the transfer is done to see if the RAM empties out any.

Offline

Board footer

Powered by FluxBB