[swap] in use while there is a large amount ram available

Posts: 96
melodie
Joined: 15 Feb 2008
#1
Hi,
Still working on trying to improve some details in a PIII Coppermine with 192 MB ram.

Here is what happens: the swap partition is being used, while there is still ram which can be used.

Code: Select all

# free -m
             total       used       free     shared    buffers     cached
Mem:           184        168         15          0          4         58
-/+ buffers/cache:        105         78
Swap:          383         35        348
The machine will go back to it's owner next, a friend of mine who is an end user to whom I will not talk about things such as"swapoff".

Although it does not seem to slow down the system (which is not very fast anyhow), I wonder if it could not be avoided.

And one more question for my understanding : could someone tell me about the numerous ram devices I can see in SpaceFM ?

Code: Select all

$ ls -l /dev/ram*
brw-rw---T 1 root disk 1,  0 Aug  9 10:28 /dev/ram0
brw-rw---T 1 root disk 1,  1 Aug  9 10:28 /dev/ram1
brw-rw---T 1 root disk 1, 10 Aug  9 10:28 /dev/ram10
brw-rw---T 1 root disk 1, 11 Aug  9 10:28 /dev/ram11
brw-rw---T 1 root disk 1, 12 Aug  9 10:28 /dev/ram12
brw-rw---T 1 root disk 1, 13 Aug  9 10:28 /dev/ram13
brw-rw---T 1 root disk 1, 14 Aug  9 10:28 /dev/ram14
brw-rw---T 1 root disk 1, 15 Aug  9 10:28 /dev/ram15
brw-rw---T 1 root disk 1,  2 Aug  9 10:28 /dev/ram2
brw-rw---T 1 root disk 1,  3 Aug  9 10:28 /dev/ram3
brw-rw---T 1 root disk 1,  4 Aug  9 10:28 /dev/ram4
brw-rw---T 1 root disk 1,  5 Aug  9 10:28 /dev/ram5
brw-rw---T 1 root disk 1,  6 Aug  9 10:28 /dev/ram6
brw-rw---T 1 root disk 1,  7 Aug  9 10:28 /dev/ram7
brw-rw---T 1 root disk 1,  8 Aug  9 10:28 /dev/ram8
brw-rw---T 1 root disk 1,  9 Aug  9 10:28 /dev/ram9
$
Is it related to the way the ram is managed ?

Thanks.
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#2
PIII Coppermine with 192 MB ram.Although it does not seem to slow down the system (which is not very fast anyhow), I wonder if it could not be avoided.
Probably can't be avoided. Iceweasel can hog ram quick with those specs.

Wait for some one more knowledgeable than me to weigh in on your other points.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#3
not sure what is meant by large amounts of ram available. From your readout it looks to me that there is a total of 184 and you have used 168 having 15 mb free, in which case the swap would be used.

as rokynji says a huge user of ram is iceweasel.

i am not sure why there are so many ram devicea in spacefm. are they also in /dev?
Posts: 96
melodie
Joined: 15 Feb 2008
#4
Hi,

"Are they also in dev ?" : please look at the content of the post I wrote. __{{emoticon}}__

"$ ls -l /dev/ram* (...)"

You are right about the amount used, I had looked at conky and thought there was really less, then pasted the"free" output without much thought about it.

I am going to try midori and see if it is better for the sake of the ram, as a modern browser.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#5
yes sorry, i read from spacefm and skipped the readout. Anyway i think it has to do with how zram opperates as my system with zram has a bunch like yours but the systems without zram not so many
Posts: 96
melodie
Joined: 15 Feb 2008
#6
Dave wrote:yes sorry, i read from spacefm and skipped the readout. Anyway i think it has to do with how zram opperates as my system with zram has a bunch like yours but the systems without zram not so many
No, I have not got zram running yet at the moment; And I am used to create one ramz block device only. I think the numerous ram devices must be related to some special settings antiX has the secret. Anyhow I would be interested to know more about it, it scratches my curiosity.
Posts: 279
afab4
Joined: 17 Oct 2009
#7
melodie wrote: And one more question for my understanding : could someone tell me about the numerous ram devices I can see in SpaceFM ?

Code: Select all

$ ls -l /dev/ram*
brw-rw---T 1 root disk 1,  0 Aug  9 10:28 /dev/ram0
brw-rw---T 1 root disk 1,  1 Aug  9 10:28 /dev/ram1
brw-rw---T 1 root disk 1, 10 Aug  9 10:28 /dev/ram10
brw-rw---T 1 root disk 1, 11 Aug  9 10:28 /dev/ram11
brw-rw---T 1 root disk 1, 12 Aug  9 10:28 /dev/ram12
brw-rw---T 1 root disk 1, 13 Aug  9 10:28 /dev/ram13
brw-rw---T 1 root disk 1, 14 Aug  9 10:28 /dev/ram14
brw-rw---T 1 root disk 1, 15 Aug  9 10:28 /dev/ram15
brw-rw---T 1 root disk 1,  2 Aug  9 10:28 /dev/ram2
brw-rw---T 1 root disk 1,  3 Aug  9 10:28 /dev/ram3
brw-rw---T 1 root disk 1,  4 Aug  9 10:28 /dev/ram4
brw-rw---T 1 root disk 1,  5 Aug  9 10:28 /dev/ram5
brw-rw---T 1 root disk 1,  6 Aug  9 10:28 /dev/ram6
brw-rw---T 1 root disk 1,  7 Aug  9 10:28 /dev/ram7
brw-rw---T 1 root disk 1,  8 Aug  9 10:28 /dev/ram8
brw-rw---T 1 root disk 1,  9 Aug  9 10:28 /dev/ram9
$
Is it related to the way the ram is managed ?

Thanks.
These are ramdisks created by the Linux kernel by default when you boot.
They don't use any memory unless you actually configure them to create a ramdisk.
Posts: 162
drg
Joined: 22 Feb 2010
#8
“Here is what happens: the swap partition is being used, while there is still ram which can be used.”

Hm, as best I understand it, well with just ‘regular’ ram/swap use.
If there is no ram available or way too little, then your machine is “out of memory”, and chances are that you’ll be kicked right out of your session, or at least some application that wants that ram will be terminated, or perhaps even a forced reboot.
The ram still available is being held available for use so that doesn’t happen.

It’s happened to me, esp. on my low ram boxes, when I’ve pushed them too far in testing. Also occasionally when an errant application just won’t let go of ram, and tries to take it all. Poof went that session.
Posts: 96
melodie
Joined: 15 Feb 2008
#9
drg wrote: Hm, as best I understand it, well with just ‘regular’ ram/swap use.
If there is no ram available or way too little, then your machine is “out of memory”
I know, but it isn't. the"free" command shows something different that conky and htop, and is probably related to another way of dealing with ram.

Here is what it really looks like:

Image

This is at early stage of the session, then it increases while there is still much of the available amount of ram still free.
Posts: 162
drg
Joined: 22 Feb 2010
#10
Aha, understand now. Good question. Hm, which way is more efficient?
When dealing with ram and swap, I mean.
Posts: 96
melodie
Joined: 15 Feb 2008
#11
drg wrote:Aha, understand now. Good question. Hm, which way is more efficient?
When dealing with ram and swap, I mean.
I read many times that the kernel Linux allows using swap disk whereas there is still enough ram to go with.

There were some tweaks provided on the web... not sure which ones now, it must be something to add in the sysctl.conf maybe...

I had not met the case lately because my machines all have more ram than that. I think the present issue has got it's solution now that zram is activated at boot and works. (See the Tips and tricks section, the thread related to zram).

The zram module having a high priority over the swap disk,"swapping" will not be so much a problem as long as the machine is used in a reasonable way. (Which I am sure it will be).