[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sarge: plenty of free RAM, but uses swap



Micha Feigin wrote:

On Sun, 30 Jan 2005, Hannes Mayer wrote:

On Sun, 30 Jan 2005 15:55:57 +0200 (IST), Micha Feigin
<michf@post.tau.ac.il> wrote:
On Sun, 30 Jan 2005, Hannes Mayer wrote:

Hi all!

I just noticed that sarge  is using swap, but there is still plenty of
memory free:
# free
            total       used       free     shared    buffers     cached
Mem:       1036532     441552     594980          0      23732     265492
-/+ buffers/cache:     152328     884204
Swap:       351752          0     351752

# uname -a
Linux debian 2.6.8-1-686 #1 Thu Nov 25 04:34:30 UTC 2004 i686 GNU/Linux

My previous distro (Fedora2) didn't use swap at all. It just occupied
almost all RAM, of course with lots of "cached" showing up at # free.
How can one force it to use RAM first and then swap ?
(I've google, but didn't find a solution)

If you read the output, in the swap entry you have

total: 351752
used: 0
free: 351752

So you are using 0 swap at the moment. Free just tells you that you have
351752 available (notice the column titles)
WOW! Silly me!
Thanks Björn and Micha!

I guess I was a bit confused, because I could hear the harddrive every
few seconds doing something tiny. Is there any way to check which
program is currently doing disk I/O ?


There may be a more strait forward way, but one method is to use laptop mode.

echo -n 1 > /proc/sys/vm/laptop_mode
echo -n 1 > /proc/sys/vm/block_dump

I think that you get the output on the console, not sure if you can see it in the terminal, maybe it will show at the end of dmesg output or /var/log/messages. I don't recall anymore, sorry.

Another way would be to use lsof, although it might be a tad bit more
information than what you're currently looking for.
But then again, it has a whole pile of switches, and there's always grep :P



Reply to: