System Using Swap When Physical Memory Available

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

System Using Swap When Physical Memory Available

Postby bscalise » Jun 20th, '12, 02:59

Could somebody help me understand the logic behind the following situation?

I have 12GB of physical RAM installed. I have another 4GB of swap configured. Right now, my Mageia is using 5.6GB of the physical RAM, and 2.9 of the swap.

I know I could set swappiness, but I've never had to before. Previous systems will use nearly all the physical memory before accessing swap memory.
bscalise
 
Posts: 10
Joined: Jun 13th, '12, 07:41

Re: System Using Swap When Physical Memory Available

Postby wintpe » Jun 20th, '12, 13:09

are you refering to magiea 1 or 2?

I personaly would assume as you have that under mageia 1 that with 12 gig of ram, no program should be usinhg swap, unless you have some pretty memory hungry apps (like gimp and big raw files).

the system will use unused memory to improve the speed of file systems by using unused memory for buffers, but that will soon get reclaimed.

you havnt shown any results from commands so im assuming this is a pretty standard setup, but if you had added shared memory for some ipc based app, like a database, then that would consume significant memory.

also some people like to configure there tmp to use tempfs, as its faster and does not store temp files on disk, but this maywell work its way into swap if they havnt been touched for a while and the machine has been up for a while.

so help us to help you, rather than guess what your PC is doing maybe you can show us.

vmstat 3 3

free

swapon -s

df -k|grep tmpfs

ipcs -m

ps -eo comm,pid,rss|sort -k 3 -n|tail -10

ps -eo comm,pid,vsz|sort -k 3 -n|tail -10

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: System Using Swap When Physical Memory Available

Postby bscalise » Jun 22nd, '12, 02:54

Wow. This mageia sure has an impressive set of folks helping out on these boards.

I've rebooted, and my memory usage levels are about where I'd expect. Specifically, .88GB of physical memory in use and 0GB of swap. Actually, that's much lower than other distributions, that usually seem to be about 1GB with just the OS loaded, and I have this broswer, plus the Mageia control center, two instances of Dolphin, two instances of Krusader, and a single instance of system monitor, so .88GB seems really good to me.

When the system exhibits the behavior I originally posted the question about, I'll run all those diagnostic tools and post the results.

I'm not sure what the memory utilization pattern was before I posted my question. I assume that I was out of physical memory and swap was being used, but it seemed to me that swap on mageia was used much more readily than I've seen other distros. Assuming the situation was that I was out of physical memory and the system started using swap, and then the physical memory freed up, it seems to me that the swap was being used far longer than I've seen other distros, to the point that physical memory had been released, but swap hadn't. If that were the case, it seems backwards to me.

Nevertheless, I will post test results once the situation re-occurs. I'll try to recreate the situation that caused it (just me using the computer for nothing in particular, just lots of applications open in an attention-deficit type usage pattern) and then run tests and post results.

Thanks!
bscalise
 
Posts: 10
Joined: Jun 13th, '12, 07:41

Re: System Using Swap When Physical Memory Available

Postby linuxero » Jun 28th, '12, 15:34

I am not quite versed in the mechanism of RAM/SWAP stuff, but to my knowledge, the OS may use the SWAP even though memory is available..am I right on this one? On the other hand, why would you expect the whole memory to be consumed even running a bunch of programmes?! Process Management is something very important and taken care of..now as for the porgrammes using memory, I suppose that the OS would try to optimise that..

So if your worry is for the unused memory and a couple of gigs used in your SWAP, I wouldn't assume this as a problem..

Hope some expert gives us a curt idea about all this.
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: System Using Swap When Physical Memory Available

Postby wintpe » Jun 28th, '12, 15:55

google or any search engine is your friend here

there are various docs around , this is one of them

http://www.linux-tutorial.info/modules. ... pageid=311

and

http://www.linuxjournal.com/article/10678

and

http://www.linuxjournal.com/article/10678

and so on

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: System Using Swap When Physical Memory Available

Postby doktor5000 » Jun 30th, '12, 20:21



Those links are intended to point at the same adress? ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18016
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: System Using Swap When Physical Memory Available

Postby wintpe » Jun 30th, '12, 21:03

Nope that was, just a cut and paste error, needless to say i should
Not need to show people how to use google, the info is out there if you look.
:D

Regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: System Using Swap When Physical Memory Available

Postby andreano » Jul 1st, '12, 03:04

If Linux thinks your RAM is more wisely spent on caching than storing programs, those programs are swapped out, to the extent loosely permitted by swappiness.
andreano
 
Posts: 13
Joined: May 18th, '12, 23:04

Re: System Using Swap When Physical Memory Available

Postby linuxero » Jul 1st, '12, 15:37

I usually spend enough time browsing for information..unfortunately many just throw out a piece of info in a webpage and you have to really look for a reliable source. I said I am not an expert, but I think I understand the system-level things enough as I prefer computers and operating systems to the movies ;)

The bottom line is that I prefer to get good information from a reliable person. If I know something I would gladly share it, if not I would just try to learn about it, find a good source then share it to be sure that I have learnt a new thing :)

Thanks again everyone
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest