LinuxQuestions.org
Register a domain and help support LQ
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 11-29-2008, 01:37 AM   #1
dnskdas
Member
 
Registered: Nov 2008
Posts: 53

Rep: Reputation: 15
What should be the ideal memory amount for swap?


Hi members,
This is my first post in this forum. I have a small question. In my institution computer, which is dual booting system with windowsXP, when I have installed fedora core 6 with a memory 2048 MB allocated to swap it seems to be very very slow in response in comparision to the earlier situation when it was allocated to be 1024 MB although in the earlier case total memory allocated for LINUX was also less. This time it is in total 36 GB, out of which I have allocated 512 MB to /boot, 10000 MB to /root, 2048 MB to <swap> and rest to /usr. The RAM is 256 MB. Is the sluggishness due to the memory allocation problem or something else ? Windows XP is running with normal speed.
-SKD
 
Old 11-29-2008, 01:53 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
256mb is probably the main reason it's horrible, certainly the disk space is completely irrelevant, and actual amount of swap shouldn't matter. run "free -m" to show the current usage of memory, the more swap being used, the slower your system is going to run.

Last edited by acid_kewpie; 11-29-2008 at 03:52 AM.
 
Old 11-29-2008, 01:53 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Hi,

And welcome to LQ!

More than twice the amount of RAM for swap is unusual,
to say the least. But I can't imagine it being more
sluggish with 2048 than it was with 1024 (unless you
were experiencing many OOM-killers with the smaller
SWAP)....

Of course, I've got no idea what FC's memory requirements
are at all ...


Cheers,
Tink
 
Old 11-29-2008, 07:55 PM   #4
bapigoo9
Member
 
Registered: Aug 2008
Posts: 107

Rep: Reputation: 16
Quote:
The RAM is 256 MB
Not that much RAM. What kernel are you running on your computer? It would be intereting to see what your swap usage is during running Linux. Does your distro have usage graphs?
 
Old 11-29-2008, 08:14 PM   #5
claudius753
Member
 
Registered: Jan 2004
Distribution: Mac OS X 10.6.4 "Snow Leopard", Win 7, Ubuntu 10.04
Posts: 322

Rep: Reputation: 31
With only 256 MB of RAM, you may want to try a lighter distro such as puppy or at least switch to a lighter desktop such as Xfce instead of Gnome (Fedora default) or KDE. That should give you a nice speed boost.
 
Old 11-29-2008, 08:41 PM   #6
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,731

Rep: Reputation: 196Reputation: 196
You might also try opening a terminal and running "top", perhaps first running "man top" to get an idea what top shows.

There are lighter window managers, but puppy or vectorlinux or some other built for small capacity or older systems might give better results.
 
Old 11-29-2008, 09:05 PM   #7
mohaas05
Member
 
Registered: Oct 2008
Posts: 41

Rep: Reputation: 16
The general rule of thumb for swap is twice your RAM. So if you have 256Mb of RAM, assign 512MB for swap.

And don't be discouraged by the amount of RAM. I run GNOME just fine on 256MB and it runs quite well, even with basic compositing. KDE however, is another story.
 
Old 11-29-2008, 09:27 PM   #8
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by mohaas05 View Post
The general rule of thumb for swap is twice your RAM. So if you have 256Mb of RAM, assign 512MB for swap.
And what if you need to run a program that takes up 769MB of memory space? There is no cut and dried answer for how much swap space, though it is clearer with smaller memory footprints and slow processors. Still, it depends on what you're going to use the machine for. I would question the decision to run 256MB on a machine with this much disk storage. Memory is too cheap, anymore, to diddle around with 256MB of RAM; unless you're pretty sure that's all you'll need. In which case, you'd already know what your swap requirements would be.

The important thing to remember about swap is that it's slow: bone crushingly, boringly, bang your head against the wall slow. If your machine is swapping, the answer is not likely to be to add more swap space.
 
Old 11-29-2008, 11:16 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Quote:
Originally Posted by Quakeboy02 View Post
And what if you need to run a program that takes up 769MB of memory space?
With 256MB RAM "running" a program that needs 769 is
wishful thinking ... crawling (grinding?) may describe
it, personally I'd stay clear of the program ;}
 
Old 11-30-2008, 12:08 AM   #10
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by Tinkster View Post
With 256MB RAM "running" a program that needs 769 is
wishful thinking ... crawling (grinding?) may describe
it, personally I'd stay clear of the program ;}
That was kinda the point of my whole diatribe. Desktop machines using a lot of swap equals misery. It doesn't matter whether it's 2 times RAM or 1 times RAM, it's still misery. We just don't do the sort of things on our desktop that they were doing when this 2 times RAM rule of thumb was the mainstay.
 
Old 11-30-2008, 12:44 AM   #11
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Lots of ram requirement.

Running a laptop with 196megs ram and a 256meg swap. Running something that uses that much memory on the laptop would grind it to a halt ( 400mhz processor + 196 ram and slow hard drive ) but if i need to recompile openoffice or something i just create a temporary file for swapping.

Laptop runs genome ( stripped ) or kde full pretty well.

Basically if you now that you need more swap then make it a little bigger than the normal 2xmemory. If you only need lotsa ram occasionally would just create a temporary swap and use that too till you finish. If this doesn't get your system where you want it could try a lighter distro or strip down the one that you are using.

Last edited by Hern_28; 11-30-2008 at 12:46 AM.
 
Old 11-30-2008, 02:38 AM   #12
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
Just for comparision, your RAM is about a thousand times faster than your harddisk.
 
Old 11-30-2008, 04:04 AM   #13
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,901

Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
Quote:
Originally Posted by Quakeboy02 View Post
Desktop machines using a lot of swap equals misery. It doesn't matter whether it's 2 times RAM or 1 times RAM, it's still misery. We just don't do the sort of things on our desktop that they were doing when this 2 times RAM rule of thumb was the mainstay.
It is not necessarily the case that "using a lot of swap equals misery".

What equals misery, to use your phrase, is having lots of traffic to and from swap, so, in the case that you have several programs that are primarily held inactive in the background, the use of some swap may not be that bad for the performance of the apps that are in the foreground. (Not exactly good either, just not causing an appreciable additional slowdown.)

Of course, the performance will decrease when you have to get things back from swap, but there are special cases in which this can be easily tolerable.

But I agree with the general thrust of this thread that the rule of thumb for swap, back from the days in which 8 M of ram was an expensive thing, and the only people who had 16 were doing really high powered stuff (albeit slowly), is just useless these days.

If the OP really wants help in getting the computer to run more smoothly (as oppsed to just getting random "Well now I now what I should of done so that Linux would be faster than Windows, as it should be" excuses) then there will have to be real information here; as mentioned, a 'top' result would be a good start, as would some information on what you are trying to do and info on what/when exactly it runs slowly.
 
Old 12-07-2008, 04:22 AM   #14
dnskdas
Member
 
Registered: Nov 2008
Posts: 53

Original Poster
Rep: Reputation: 15
Thank you guys for all of your response. I actually have been very busy with some training work and presently out of station. I would analyse the situation after returning. I know that 256 MB RAM is not good and using a high memory demanding software is difficult with it. Actually I wanted to know that whether it becomes slower by just allotting more space to SWAP. At my home Ihave 512 MB RAM and it is working fine even on KDE desktop. Here I have allocated 1024 MB to SWAP.
-SKD
 
  


Reply

Tags
allocation, memory


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
LXer: Linux: Should You Use Twice the Amount of Ram as Swap Space? LXer Syndicated Linux News 1 11-19-2008 05:02 PM
check amount of memory naijaguy Linux - General 4 10-15-2008 02:11 PM
Increasing the amount of cached memory balteo Linux - General 1 09-16-2005 04:06 PM
checking amount of free memory sanjith11 Linux - Software 6 05-13-2004 10:11 AM
X uses an excessive amount of memory! ~80Mb kamstrup Linux - Software 3 08-18-2003 06:42 AM


All times are GMT -5. The time now is 10:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration