LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2004, 12:41 PM   #1
Andy@DP
Member
 
Registered: Aug 2003
Location: Aberdeen, UK.
Distribution: Debian, Ubuntu
Posts: 208
Blog Entries: 2

Rep: Reputation: 30
Getting swap to work


My swap space isn't used and I'm running quite high. Here is the output from free:
Code:
             total       used       free     shared    buffers     cached
Mem:        514736     466404      48332          0      52844     201488
-/+ buffers/cache:     212072     302664
Swap:      1028152          0    1028152
Thats fairly close to max ram and I can't afford new stuff just now. How can I get linux (suse) to use the swap and clear some ram?

TIA.
 
Old 05-04-2004, 12:56 PM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Code:
-/+ buffers/cache:     212072     302664
what I hightlghted in RED, is the physical RAM that is being used!!
your fine, really!!
 
Old 05-04-2004, 01:02 PM   #3
Andy@DP
Member
 
Registered: Aug 2003
Location: Aberdeen, UK.
Distribution: Debian, Ubuntu
Posts: 208
Blog Entries: 2

Original Poster
Rep: Reputation: 30
I thought it was the....
Code:
             total       used       free
Mem:        514736     466404      48332
that I had used.

So whats the top line then?
 
Old 05-04-2004, 01:13 PM   #4
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
http://www.linuxquestions.org/questi...718#post896718

check out this post..........very good explanation.........

and this thread.............


http://www.linuxquestions.org/questi...631#post475631

Last edited by 320mb; 05-04-2004 at 01:30 PM.
 
Old 05-04-2004, 02:16 PM   #5
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
i hear with the upcomming 2.6 kernels you can set swappyness by echo #percent > /proc/swappyness or somthing like that... 0 meansing down swap, 100 means swap loads..
 
Old 05-04-2004, 02:36 PM   #6
Andy@DP
Member
 
Registered: Aug 2003
Location: Aberdeen, UK.
Distribution: Debian, Ubuntu
Posts: 208
Blog Entries: 2

Original Poster
Rep: Reputation: 30
Is ths in the pipeline, or is it the latest stable 2.6 kernel?
 
Old 05-04-2004, 06:44 PM   #7
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
I don't think you really want to encourage your system to use swap, simply because the access time within RAM vs the access time to/from your hard drive is several orders of magnitude faster. The less you use swap, the better. Consider it this way: which will give you better performance (assume that RAM and swap are the same size and you are running a heavy load):

Using 95% of RAM and zero swap; --or--
Using 50% of RAM and 45% swap?

Obviously the former will be faster, because there is no disk I/O. Along these lines, what's the point of writing to disk when you have unused, available RAM? In this example it would be similar to halving the amount of RAM in your PC, and what benefit would there be in that? Swap should be considered a last resort, only to be used when physical RAM is exhausted (eg, demand for memory exceeds 100% of capacity) and the system has no other choice but to write out memory pages to disk. Forcing your system to write to disk as a matter of course while unused RAM sits idle is not what I woud consider to be a performance improvement. -- J.W.
 
Old 05-05-2004, 03:38 AM   #8
Andy@DP
Member
 
Registered: Aug 2003
Location: Aberdeen, UK.
Distribution: Debian, Ubuntu
Posts: 208
Blog Entries: 2

Original Poster
Rep: Reputation: 30
Thanks you guys,
I was a little confused about the whole free/used memory thing.

But thats cleared it up, cheers!
 
Old 05-05-2004, 04:28 AM   #9
Zipler
LQ Newbie
 
Registered: May 2004
Location: MW
Posts: 1

Rep: Reputation: 0
Question Swap and ramdisk.

Ok, I Understand in those cases how it is determining how much memory is free, and how much is being used by cache and buffers. My machine has 512MB ram installed, it is showing that I am using 410 total. My only problem is, I have 400MB set aside for a ramdisk (I would assume 512-400=112) Approx.
Why is it showing that I have a total of 340 free, and not something in the area of 0, with the swap being used?


Code:
knoppix@ttyp0[/]$ free

                  total       used       free     shared    buffers     cached
Mem:       515160     418068      97092          0      36576     208788
-/+ buffers/cache:     172704     342456
Swap:       152580          0     152580

knoppix@ttyp0[/]$ df

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 2471      1077      1394  44% /
/dev/cdrom              716702    716702         0 100% /cdrom
/dev/cloop             1914132   1914132         0 100% /KNOPPIX
/ramdisk                407024       792    406232   1% /ramdisk
/dev/hda5               608939    307231    301708  51% /mnt/hda5
/mnt/hda5/knoppix.img
                        297485      1766    295719   1% /home/knoppix
Please let me know what you think, or what you know.
Thanks alot!

ZipleR

Last edited by Zipler; 05-05-2004 at 04:40 AM.
 
Old 05-07-2004, 10:09 AM   #10
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
it all depends on how much ram you have, and what you are doing with it !

normally, i dont want my machine to swap, i have half a gig of ram which is way more than i need, so swapping is pointless.

however not too long ago i was working on an AI program.
it used 400 megs of ram, and took 1 hour to complete.

in this case, hundreds of megs of ram were sat there doing nothing for most of an hour..
just waiting untill the program had finished so the search tree could be traced,
in this case, it would have been good to swap.
 
  


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
swap file doesn't work mohtasham1983 Linux - General 13 11-17-2005 09:00 AM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 01:57 PM
Swap Won't Work in New 2.6.6 Kernel, Partition Table Messed Up DvChWi Slackware 11 06-19-2004 01:51 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM
How does Swap Space work? linuxnoobie Linux - Newbie 3 06-21-2003 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration