LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-02-2005, 06:44 PM   #1
RoaCh Of DisCor
Member
 
Registered: Apr 2004
Location: Washington State
Distribution: SuSE 9.3 / Slackware-Current
Posts: 701

Rep: Reputation: 30
Memory / Swap Usage


Hey.

For some reason, my SuSE 9.3 OS has been going quite slow lately. I opened up a RAM monitor...and noticed that my swap drive is actually being used. 13 % of it. I've heard that a swap drive being used can slow things down majorly.

I only have 256MB of RAM. Should I get more? Is more needed?

..anyway, as I said I opened up a monitor...and it says...

Total memory free 71%

Used physical Memory: 17% Used


For the physical memory...58 percent of it is used by program data, and 28% of it is disk cache. There's only 5% free of physical memory.

More importantly though, my swap drive is being used.

Here's from "top"

Mem: 255836k total, 248824k used, 7012k free, 9516k buffers
Swap: 1004052k total, 142736k used, 861316k free, 86312k cached

As you may be able to tell, I don't really understand allot of this...except if your memory is being used up, it's going to cause problems .

Can anyone provide me with some help? Thanks!

-RoaCh

Last edited by RoaCh Of DisCor; 05-02-2005 at 06:45 PM.
 
Old 05-02-2005, 06:49 PM   #2
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
Memory handling is a kernel's job and should be best left to it. However you can check for programs you are not using and kill them to free up some memory. SSH, Samba immediately comes to mind.
 
Old 05-02-2005, 06:54 PM   #3
mugwump84
Member
 
Registered: Mar 2005
Distribution: Arch Linux
Posts: 61

Rep: Reputation: 15
I'm not familiar with SuSE, so I can't tell how to do this, but disable some services and programs that load on bootup, or logon.</stock_answer>
 
Old 05-02-2005, 07:07 PM   #4
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Theoretically, no matter how much ram you have, adding swap can make your system faster. That being said, you may want to get a little worried when your swap drive starts to show a lot of useage. Some swap use is fine, but obviously, a lot is bad.

From the top output:
Quote:
Mem: 255836k total, 248824k used, 7012k free, 9516k buffers
Swap: 1004052k total, 142736k used, 861316k free, 86312k cached
It does look like you are using a lot of ram. You can call the "buffers" and "cached" ram free if you want to. Those buffers will be freed whenever an application needs more memory. So, you have about 17MB of "free" ram out of 256, and you have 143MB of swap used. Yeah, it does look like you can use some more ram. I think you would notice a speed bump from another 256 or so.

Also, I like the "free -m" output a little better. Here is what mine looks like. This is in MB.
Code:
             total       used       free     shared    buffers     cached
Mem:          2008       1921         87          0        373        918
-/+ buffers/cache:        629       1379
Swap:         1961          0       1961
I'll decipher this as an example. My sytem as 2GB of ram. 1.921GB is used, 87MB is free, 373 is used for buffers, and 910MB is used for cache. This means, that for all intents and purposes, I have 87+918+373 ~= 1378MB of "free" ram. I like the "free" output because it will give this summary for you on the (-/+) line:
Code:
             total       used       free     shared    buffers     cached
-/+ buffers/cache:        629       1379
So, you can see that while I only have 87MB free, I really don't have anything to worry about because my system can have a total of 1379MB available whenver my apps need it. I hope this example helps.
 
Old 05-02-2005, 07:13 PM   #5
RoaCh Of DisCor
Member
 
Registered: Apr 2004
Location: Washington State
Distribution: SuSE 9.3 / Slackware-Current
Posts: 701

Original Poster
Rep: Reputation: 30
Thanks, that does help I'll probably get more RAM..because really, now days 256 really isn't very much. I did disable some services though through yast..maybe that will help for now.
 
Old 05-02-2005, 08:06 PM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
I likewise would recommend adding more RAM assuming your budget allows it. As you said, anytime swap is actually used, your system performance tends to go down the drain because of the simple fact that reading/writing to the hard drive is measured in milliseconds, while accessing RAM is measured in nanoseconds. The more your system has to manage memory using the hard drive, the worse your response times will be. Some intermittant swap usage is no big deal, but if you're consistently using 13% of a 1G swap (yipes!) then it's no wonder your response times are poor.

Overall, I'd suggest boosting RAM to 512Mg and to reduce swap to 256Mg tops (even today, where you are using a lot of swap, keep in mind that only about 130Mg of that 1G space is being used, and the rest is sitting around not doing anything.) Lastly, the more RAM you have, the less likely swap will come into play and with 512Mg most likely both your swap usage will drop dramatically and your system performance should improve significantly. Good luck with it -- J.W.
 
Old 05-02-2005, 10:35 PM   #7
RoaCh Of DisCor
Member
 
Registered: Apr 2004
Location: Washington State
Distribution: SuSE 9.3 / Slackware-Current
Posts: 701

Original Poster
Rep: Reputation: 30
Ok, thanks again.

Now..any suggestions on where to purchase *low cost* RAM?

Heh .
 
Old 05-03-2005, 12:43 AM   #8
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
NewEgg. Great prices, amazing service. Pretty much for me, I buy everything from NewEgg. (FYI - I have no connection or affiliation with them, I'm just always had excellent experiences with them and would recommend them without hesitation -- J.W.
 
Old 05-03-2005, 12:35 PM   #9
greghat
LQ Newbie
 
Registered: Apr 2005
Location: Detroit
Distribution: Mandrake 9.2
Posts: 6

Rep: Reputation: 0
Now my understanding of RAM use and SWAP in Linux is clearer.
But to dig in a little deeper, please help me with the following.

My box has 2 GB of ram, Mandrake 9.2. When booting I get the following available linux boot systems..
Linux and Linux Enterprise.
I understand that Linux Enterprise is for systems that have more than 1 GB Ram.

If I boot in Linux, I only get a reporting of 1GB of Ram.
Of which in the KDE Memory Control Module I get the following usage report..
Application Data 10%
Disk Cache 11%
Free Physical Memory 77%

Also under the KDE Information Processor Control, this boot process shows the single processor that I have in the box,
In the case of the Enterprise boot, below, I get a false report of 2 processors onboard.

In this case is the computer only recognizing and using 1 of the 2 GB's available to it?
and what's with the false reporting on the processor?
and what's with the Application Data using 62%?(below)

If I boot in Linux Enterprise I get the 2GB of Ram and in the KDE Memory Control Module I get the following usage report..
Application Data 62%
Disk Cache 7%
Free Physical Memory 31%

Any information on this would be greatly appreciated.
Thank you,
Greg
 
Old 05-03-2005, 01:32 PM   #10
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
greghat,

Well, it depends on how your kernel is configured. In order to get my computer to "see" all of my ram, I have to enable "high memory support" when configuring the kernel. I think you need highmem enables to use more than 1GB of ram. I'm guessing whatever kernel you have doesn't have this feature enable, and therefore can't see you all your memory. As for reporting two processors, do you have a HTT(Hyper Threading) enabled pentium4 or Xeon chip? Linux does support HTT, and that may be why you see an extra "logical" processor.

Hope that helps.
 
Old 05-03-2005, 10:48 PM   #11
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
visaris is correct. If you've got 2G of RAM, you will want to recompile and enable High Memory Support
Code:
Processor Type and Features ---->
High Memory Support ---->
(X) 4GB
Good luck with it -- J.W.
 
Old 05-04-2005, 12:40 AM   #12
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
Quote:
Now..any suggestions on where to purchase *low cost* RAM?
1) eBay. Even paying top eBay dollar for memory is cheaper than the retail options.

----------

2) Any time you see significant swap partition usage (significant = more than a few percent), it’s time to add memory. And if you can’t add memory because of physical limitations, then you should think about replacing your system. Significant swap usage just kills performance.

Regarding the old rule of swap size = twice memory size, that’s so out of date, it isn’t even funny with modern systems (modern = P-III or newer), but you read it every day in this forum. The most swap I ever enable is 500MB, regardless of how much memory is in the system. And even that is a waste of disk space in most cases.

Guys, this isn’t windows, which would fall over dead without “swap”.
 
Old 05-04-2005, 09:43 AM   #13
greghat
LQ Newbie
 
Registered: Apr 2005
Location: Detroit
Distribution: Mandrake 9.2
Posts: 6

Rep: Reputation: 0
That's a yes on the HTT(Hyper Threading), I have a P4 3.60, HTT is enabled in the BIOS.

As far as the "enable "high memory support" " I'll have to dig into that.

Thanks for the great information.
Greg

p.s. fyi to past posts
I'm printing out large format prints with images in the range of 250Mb to 500Mb, and I just barely get into my swap area. I'm assuming at this point that my 2GB of Ram is being used. But I'll have to do further checks.
I've also learned that it was only some printers that have issues with starting with the Linux mode.
From this point I am going to Run with Linux Enterprise to see how it goes.
 
Old 05-04-2005, 10:39 PM   #14
RoaCh Of DisCor
Member
 
Registered: Apr 2004
Location: Washington State
Distribution: SuSE 9.3 / Slackware-Current
Posts: 701

Original Poster
Rep: Reputation: 30
Ahhh 35% of my swap is being used now! Well, hopefully I'll get some RAM soon . I wonder why my swap is being used though? Other distros I haven't had much problem..but possible it's the new KDE...or different programs. Most of it's application data that's eating up my physical memory.
 
Old 05-04-2005, 11:26 PM   #15
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
yea it's also really the application data that ever ends up in swap because it's really the only thing in ram that can't get reread off the disk like executables and libs can. User application data goes into the swap cue as soon as it's created so when memory preasure comes along it can get saved without alot of thought and everything else just gets tossed out
 
  


Reply



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
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
memory/swap usage koy Linux - Newbie 2 05-18-2004 11:12 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM

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

All times are GMT -5. The time now is 02:35 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
Open Source Consulting | Domain Registration