LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-26-2009, 04:30 PM   #1
Randymanme
Member
 
Registered: Jul 2009
Location: Columbus, OH, USA
Distribution: Ubuntu 12.04; Knoppix 7
Posts: 121

Rep: Reputation: 16
Question Memory "swapping?"


Seems like I read somewhere about how a computer can temporarily use a “patch” of the hard drive for RAM to help out when a computer has a low amount of RAM. Is that “swapping?” How can I get my computer to do that?

Compaq Presario 543OUS series 5000
RAM 256Mb; Clock 1.8 Gb
Hard Drive 30 Gb
16X Max* DVD-ROM; CD-RW
NVIDIA accelerated graphics driver (version 96) (recommended) [disabled]
Ubuntu 9.04; Ff 3.5.2

Last edited by Randymanme; 08-26-2009 at 04:38 PM. Reason: computer specs added
 
Old 08-26-2009, 04:42 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Randymanme
Seems like I read somewhere about how a computer can temporarily use a “patch” of the hard drive for RAM to help out when a computer has a low amount of RAM. Is that “swapping?” How can I get my computer to do that?
Yes, and it's not a good thing if your computer has to do that with any regularity. Disk I/O is very slow when compared with RAM.

What is the problem you're having, exactly? Also, post the output of: $ free
 
Old 08-26-2009, 04:50 PM   #3
DragonSlayer48DX
Registered User
 
Registered: Dec 2006
Posts: 1,454
Blog Entries: 1

Rep: Reputation: 74
Typically all OSes are written to set up and use the "swap file" automatically. Are you having problems that lead you to believe yours isn't doing that?
 
Old 08-26-2009, 06:53 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
By default, most if not all distros install a swap partition (similar but different to swap file), unless you told it not to.
Post the results of

fdisk -l

df -h

You'll need to be root for fdisk.
 
Old 08-26-2009, 10:23 PM   #5
Randymanme
Member
 
Registered: Jul 2009
Location: Columbus, OH, USA
Distribution: Ubuntu 12.04; Knoppix 7
Posts: 121

Original Poster
Rep: Reputation: 16
randall@Randall:~$ free

total used free shared buffers cached

Mem: 250784 241932 8852 0 4644 59912

-/+ buffers/cache: 177376 73408

Swap: 722884 186836 536048

randall@Randall:~$ fdisk -l

randall@Randall:~$ apt-get fdisk -1

E: Command line option '1' [from -1] is not known.

randall@Randall:~$ df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda1 27G 4.5G 22G 18% /

tmpfs 123M 0 123M 0% /lib/init/rw

varrun 123M 212K 123M 1% /var/run

varlock 123M 0 123M 0% /var/lock

udev 123M 144K 123M 1% /dev

tmpfs 123M 1.5M 122M 2% /dev/shm

lrm 123M 2.2M 121M 2% /lib/modules/2.6.28-15-generic/volatile

/home/randall/.Private

27G 4.5G 22G 18% /home/randall

randall@Randall:~$



Basically, I'm just curious. But also curious about how I can improve my computer's performance capacity without having to buy something (like, say, another RAM card). A couple of days ago, I tried to do some things that I didn't get to do after having been told up front that I don't have enough RAM.

Plus I was wondering if my desktop's random freezing [especially during the (attempted) playing of videos on line] might have something to do with RAM. But I don't think so, now [see my last posting on the below thread]:

* LinuxQuestions.org > Forums > Linux > Linux - Newbie I already have sun-java6-bin and sun-hava6-jre.

[Not to be doing a double post; but just to give an honest response to]:

“What is the problem you're having, exactly? Also, post the output of: $ free”

Thanks a lot for considering my question and giving me qualitative feedback.

P.s.

randall@Randall:~$ sudo apt-get fdisk -1
[sudo] password for randall:
E: Command line option '1' [from -1] is not known.
randall@Randall:~$

Last edited by Randymanme; 08-26-2009 at 10:26 PM. Reason: More info
 
Old 08-26-2009, 10:37 PM   #6
mobinskariya
Member
 
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367

Rep: Reputation: 55
syntax for apt is
Code:
apt-get install packagename
 
Old 08-27-2009, 07:58 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by Randymanme View Post
also curious about how I can improve my computer's performance capacity without having to buy something (like, say, another RAM card).
Probably you can't. You already have swap space nearly triple the size of ram. If you run anything that needs that much swap space, it will probably run very slowly.

Quote:
I tried to do some things that I didn't get to do after having been told up front that I don't have enough RAM.
How were you told you don't have enough ram? (A person told you? Or an error message from the computer when you tried to run something? Or requirements listed on a website? Or what?)

You can increase the memory capacity of your system by increasing the amount of swap (increase the swap partition size or add a swap file). Then large tasks that currently would fail because of lack of memory would instead work but very slowly.

Since you just have 30GB of disk, increasing swap space may not be an easy tradeoff. Is there really something too big to run now that is important enough to run even if it must run very slowly?

Quote:
I was wondering if my desktop's random freezing [especially during the (attempted) playing of videos on line] might have something to do with RAM. But I don't think so,
Maybe, but I don't think so either. If you mean short periods of "freezing", more likely the fault is in your internet provider. If you mean it stays frozen until reboot, that is likely a hardware problem, but also likely not because of having too little ram.
 
Old 08-27-2009, 09:56 AM   #8
Randymanme
Member
 
Registered: Jul 2009
Location: Columbus, OH, USA
Distribution: Ubuntu 12.04; Knoppix 7
Posts: 121

Original Poster
Rep: Reputation: 16
randall@Randall:~$ apt-get install packagename
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
randall@Randall:~$ sudo apt-get install packagename
[sudo] password for randall:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package packagename
randall@Randall:~$
 
Old 08-27-2009, 04:59 PM   #9
DragonSlayer48DX
Registered User
 
Registered: Dec 2006
Posts: 1,454
Blog Entries: 1

Rep: Reputation: 74
Quote:
Originally Posted by Randymanme View Post
randall@Randall:~$ apt-get install packagename
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
randall@Randall:~$ sudo apt-get install packagename
[sudo] password for randall:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package packagename
randall@Randall:~$
What exactly are you trying to install?

Quote:
sudo apt-get install
is the proper syntax for installing packages, however, fdisk is an internal command (same as apt), and packagename is not a relevant package. You need to know the proper name of the package and replace "packagename" with that.
 
Old 08-27-2009, 07:16 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Can you show the output of the 'top' cmd ?
 
Old 08-28-2009, 09:24 PM   #11
mobinskariya
Member
 
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367

Rep: Reputation: 55
Quote:
Originally Posted by Randymanme View Post
randall@Randall:~$ apt-get install packagename
randall@Randall:~$ sudo apt-get install packagename
randall@Randall:~$
packagename is not something you should install..i was just describing how to install something named packagename.
also i think your swap is working
Quote:
Originally Posted by Randymanme View Post
randall@Randall:~$ free

total used free shared buffers cached

Mem: 250784 241932 8852 0 4644 59912

-/+ buffers/cache: 177376 73408

Swap: 722884 186836 536048
from the above output we can see that you have got 728mb or something of swap of which 186mb is used and the rest is unused.

Last edited by mobinskariya; 08-28-2009 at 09:49 PM.
 
Old 08-28-2009, 11:45 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Your computer would *greatly* (and I really mean *greatly*) of having another ram stick.

Just some comments so you get a general picture: access time of ram chips is measured in nanoseconds (10^-9), access time of hard disks is measured in miliseconds (10^-3), that's six orders of magnitude of difference. That means that in the best case, a hard disk is many million times slower than a ram chip. Disks are mechanical, chips are electronic.

You can now start realizing that the disk can never substitute your ram. Swapping is useful sometimes to store stuff that's not so frequently used, but when your ram is full and swap becomes a must, then you are running over your posibilities, and that means that you either need to run lighter programs or buy more ram. Otherwise, the performance will be a fraction than it should be. Period.

Your ram is full, so you can expect a very noticeable improvement in your performance if you buy another stick of ram. That, or use a lighter distribution and choose wisely your software.
 
Old 08-29-2009, 05:33 AM   #13
Randymanme
Member
 
Registered: Jul 2009
Location: Columbus, OH, USA
Distribution: Ubuntu 12.04; Knoppix 7
Posts: 121

Original Poster
Rep: Reputation: 16
Wink

A local (here) computer recycling concern decided some time back to raise the RAM floor on the free computers that it distributes to 512 MB; citing as its primary concern that if average, at home, users ran two heavyweight apps (like, say, OOo and a loaded Ffx; or just watching Hulu or Youtube) simultaneously with less RAM, the computers would start swapping, get slow or unresponsive, and then the users would blame Linux and go to (or back to) microsoft or mac.

Now I read that (in an org email) over a month ago. But at the time I didn't know what swapping was – thanks to you all, I can reread that email with more comprehension. Myself, its only been since configuring Wine to Windows XP that I can use OOo in one window and have Linux ?.org in another window at the same time. Listening to Youtube while using OOo was out of the question. This and the next is in response to Johnsfine's query about who told me I don't have enough RAM.

I have an OpenSuse live CD [odd that it doesn't register in the CD-RW drive but does in the DVD-ROM drive and it's definitely a CD] that tells me when I click the install button that since I don't have 1 GB of RAM, it may not work – and it doesn't. And when I just open the live CD, it opens but won't function.

Before I configured Wine, this sucker would freeze and stay froze until I did a hard reboot.

When I entered sudo apt-get install packagegame, I wasn't trying to install anything – I just did it because somebody put in a response. It didn't seem anymore generic to me than the update source list command –I didn't know any better. I have used it today, though, trying to install ie6 and ies4linux (see my thread “I want to activate my Road Runner account.”).

The “output of the 'top' command(?)” Sure:

randall@Randall:~$ fdisk -l

randall@Randall:~$ apt-get fdisk -l

E: Command line option 'l' [from -l] is not known.

randall@Randall:~$ sudo apt-get fdisk -l

[sudo] password for randall:

E: Command line option 'l' [from -l] is not known.

randall@Randall:~$ fdisk



Usage: fdisk [-l] [-b SSZ] [-u] device

E.g.: fdisk /dev/hda (for the first IDE disk)

or: fdisk /dev/sdc (for the third SCSI disk)

or: fdisk /dev/eda (for the first PS/2 ESDI drive)

or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)

...

randall@Randall:~$ fdisk /dev/hda



Unable to open /dev/hda

randall@Randall:~$ sudo apt-get fdisk /dev/hda

E: Invalid operation fdisk

randall@Randall:~$



Please assume that I'm dumber that a box of rocks (e.g. my misunderstanding of the packagegame example). Someone is going to have to tell me verbatim how to get fdisk -1 output.

When I say “Thank you very much,” I really mean it.

Thank you very much.
 
Old 08-29-2009, 05:41 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
I am not sure why do you want to run fdisk -l (it's little lower case 'L', not the number one).

But you need to be the root user, which is the god-like account with all the privileges (fdisk is potentially harmful, but don't worry, fdisk -l just lists the partitions and disks). I see in your profile that you seem to be using ubuntu, and in ubuntu you can't login as root by default. You have to use sudo instead. Maybe you just need to run this:

Code:
sudo fdisk -l
If that doesn't work then you need to install it. I assume with "apt-get install fdisk" or something like that. But I really doubt that fdisk isn't installed by default. However, as said, I have no idea what the purpose of running that command is. It will just list the layout of your disk(s). If you plan to use a bigger swap space, please, don't do it. It won't increase your performance or the capabilities of your computer. As I said above, the only way that your computer will be able to deal with the current load is by increasing the size of the available ram. You already have more swap space than you need.
 
Old 08-29-2009, 07:41 AM   #15
Randymanme
Member
 
Registered: Jul 2009
Location: Columbus, OH, USA
Distribution: Ubuntu 12.04; Knoppix 7
Posts: 121

Original Poster
Rep: Reputation: 16
Chrism01 asked me to run it (I guess for more informantion on 826-09). And again the next day.
 
  


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
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
Measure "CPU load" and "memory consumption" of a process DaneelGiskard Programming 3 08-30-2007 12:43 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM
Reinstalling Win98SE when "drive swapping" is required OldBob Linux - Laptop and Netbook 8 10-29-2004 09:19 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 04:11 PM


All times are GMT -5. The time now is 06:20 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