You are not logged in.

#1 2007-12-20 00:58:28

colbert
Member
Registered: 2007-12-16
Posts: 809

Question about memory usage and swap drive

I have 1.2gb ram and a 4gb swap drive (I set it to 4 many other distro installs ago, never bothered to change it, don't know if it would make sense to?).

In system monitor, I always see the memory usage, and for example right now it's 501mb of 1.2 gb used, but my Used Swap is 0 of 3.9gb. Is that right? Shouldn't it be using my swap drive? I notice when I have many tabs (and I tend to use a lot of tabs in firefox and opera) it goes to 70-80% memory usage and gets a bit sluggish for a moment until I close tabs, but it seems my swap drive is doing nothing. Is this correct behaviour for the swap or shouldn't it be getting "used" ??

TIA for your help folks smile

Offline

#2 2007-12-20 01:23:54

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Question about memory usage and swap drive

As far as I know, this is good. Moving things to the swap and reading  from the swap is slow: it's a hard drive. I think Linux's policy is to use up all the 'real' memory (RAM) all the time. As long as no new process asks for memory, it will keep stuff in there even if the process that put it there is long gone. Try this: issue the 'find' command. Now issue it a second time. It's faster the second time, because whatever it found the first time is still in memory (at least, I think that's what goes on, but I haven't read code or anything).

This reading might be interesting: http://tldp.org/HOWTO/Unix-and-Internet … ement.html

Offline

#3 2007-12-20 02:43:15

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Question about memory usage and swap drive

The swap drive you have may not be enabled.

In kde, Ksysguard provides an insight into swap use and will present any swap device size which is enabled.  The progress of ram use and swap use is provided.

Command line df -ak will also define the swap available.

If none is identified, then the command line ..swapon -a.. is recommended if you desire swap enabled.

You may also have to ID the device, such as .../dev/hda2 ...or some such in the command.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2007-12-20 02:46:52

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: Question about memory usage and swap drive

The behavior you see is as expected.
SWAP memory is only used once the system runs out or RAM and since your system is only using part of the available RAM, the swap space is not touched.

Hope this helps.

R.

Offline

#5 2007-12-20 04:18:15

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Question about memory usage and swap drive

Thanks guys, much appreciated. That clears it up for me smile

Offline

Board footer

Powered by FluxBB