LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-24-2010, 09:03 PM   #1
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Rep: Reputation: 30
How to prioritize the use of physical memory instead of swap?


Hi

I have a system with 2G of memory and swap memory of 4G.
This is the output from :


$cat /proc/meminfo

PHP Code:
$cat /proc/meminfo 
MemTotal
:        2046312 kB
MemFree
:          209800 kB
Buffers
:           60532 kB
Cached
:          1284560 kB
SwapCached
:            4 kB
Active
:           953280 kB
Inactive
:         754836 kB
Active
(anon):     226108 kB
Inactive
(anon):   138064 kB
Active
(file):     727172 kB
Inactive
(file):   616772 kB
Unevictable
:           0 kB
Mlocked
:               0 kB
SwapTotal
:       4256664 kB
SwapFree
:        4256660 kB
Dirty
:               112 kB
Writeback
:             0 kB
AnonPages
:        363032 kB
Mapped
:            85688 kB
Shmem
:              1148 kB
Slab
:              62920 kB
SReclaimable
:      47532 kB
SUnreclaim
:        15388 kB
KernelStack
:        2440 kB
PageTables
:        24484 kB
NFS_Unstable
:          0 kB
Bounce
:                0 kB
WritebackTmp
:          0 kB
CommitLimit
:     5279820 kB
Committed_AS
:    1825604 kB
VmallocTotal
:   34359738367 kB
VmallocUsed
:      308512 kB
VmallocChunk
:   34359403404 kB
DirectMap4k
:      225152 kB
DirectMap2M
:     1869824 kB 
How could they do to the memory cache to be used as much? Because, occasionally,
swap is used and note that the system could use the memory cache does not swap ...


Thanks

ps: Slackware current 64 multilib
 
Old 10-24-2010, 09:23 PM   #2
maxmiorim
Member
 
Registered: Sep 2010
Location: Brazil
Distribution: Slackware
Posts: 43

Rep: Reputation: 8
You may want to tune /proc/sys/vm/swappiness, see http://kerneltrap.org/node/3000.

Also, linux-mm.org (more specfically, http://linux-mm.org/LinuxMMDocumentation and http://linux-mm.org/LinuxMMInternals) helps to understand how the whole memory management thing works.
 
1 members found this post helpful.
Old 10-24-2010, 09:44 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,314

Rep: Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172
Precisely 1 page of swap is in use. That single page is (swap)cached - meaning it will be read from memory, not read in from disk should it ever be referenced again. That single page was probably swapped out because it hadn't been referenced in ages.
How much more efficient can it get ?.
 
Old 10-24-2010, 10:30 PM   #4
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
maxmiorim

È estranho para mim mesmo dizer obrigado a um compatriota (em ingles) ,de toda forma ai vai ...

Muito obrigado pelo links,tentarei entender o que esta escrito em ingles( meu ingles é muito ruim ) e o seu conteudo ,de toda forma,
pelo pouco que li ,me parece muito interessante ....

ps:Eu sei que a linguagem no forum é o ingles ,não fique aborrecido comigo mesmo :-)

Quote:
translation

It is strange to me even to say thanks to a fellow (in English), anyway here it goes ...

Thank you for the links, try to understand what is written in english (my english is very bad) and its contents, anyway,
the little I've read, it seems very interesting ....

ps:I know the language the forum is english, do not get upset with myself
||-------------------------------------||

syg00

Haaa ... I think I understood then ....

thanks
 
Old 10-25-2010, 04:52 PM   #5
stitchman
Member
 
Registered: Dec 2005
Distribution: Slackware 13.1
Posts: 82

Rep: Reputation: 15
This might or might not help you, but if you are like me and see that swap is used and you have memory free, use the swapoff command.

You can then swapon /dev/<swap partition> to get a cleared out swap space.

Or if you are feeling very adventurous, get some more memory and run without any swap!
 
Old 10-25-2010, 11:04 PM   #6
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by stitchman View Post
This might or might not help you, but if you are like me and see that swap is used and you have memory free, use the swapoff command.

You can then swapon /dev/<swap partition> to get a cleared out swap space.

Or if you are feeling very adventurous, get some more memory and run without any swap!
That's what I normally do, thanks. :-)

Anyway, if I translate correctly so that I can even understand the explanation of syg00,
satisfy me ...

many thanks

ps:I think it is hard to find is the simplicity ...
 
Old 10-26-2010, 05:20 PM   #7
rmjohnso
Member
 
Registered: Mar 2006
Location: Wisconsin
Distribution: Slackware64-Current
Posts: 294

Rep: Reputation: 43
Quote:
Originally Posted by stitchman View Post
This might or might not help you, but if you are like me and see that swap is used and you have memory free, use the swapoff command.

You can then swapon /dev/<swap partition> to get a cleared out swap space.

Or if you are feeling very adventurous, get some more memory and run without any swap!
I've not run with swap in years. Once I got to 2GB of RAM, I found I never was using swap on my laptop, so I just stopped making a swap file and / or swap partition. I've got 4 GB now, and I have yet to encounter any issues.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why dmesg | grep Memory gives two different physical memory amounts? jstitch Linux - Hardware 1 10-21-2010 12:52 AM
PCIe dma-able memory location in physical memory for Intel Nehalem / Tylersburg arch robvoo Linux - Kernel 4 07-31-2009 07:21 AM
Swap space did not function when physical memory ( RAM ) is full rabbit00 Linux - Newbie 19 07-06-2009 10:18 PM
how to use swap more than the physical memory Santosh_d Linux - General 9 03-24-2004 03:51 PM
swap drive, physical memory glock19 Linux - General 6 03-08-2002 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration