LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-03-2008, 10:01 AM   #1
Person_1873
Member
 
Registered: Sep 2007
Location: Australia
Distribution: Gentoo / Debian / Rasbian / Proxmox
Posts: 519

Rep: Reputation: 44
make ubuntu 8.04 use RAM before SWAP


i have an old P4 laptop with 768MB of RAM, i noticed it idling and making a clicking sound as though it was working hard, i fired up the system monitor to find that it was using 28MB worth of swap space while only using a third of the available RAM, is there any way to change the priority to use all the RAM first?
 
Old 12-04-2008, 05:29 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Ubuntu (and all linux OS that I have tried) will automatically use all RAM before using swap. Open a terminal and post the output of this command: "free -m". Mine looks like this:
Code:
tom@debian:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          2027        380       1646          0         15        170
-/+ buffers/cache:        195       1832
Swap:          996          0        996
This means that I have 2027mb total ram, with 380 used and 1646 free. But note the -/+ buffers/cache line, plus the buffers and cached colums on the right. Of the 380mb used, 195 is used by programs, plus 15 + 170 cached. 195 + 15 + 170 = 380. Also, as you can see, I am not using any swap.

As for the "clicking sound", you probably need to enable laptop mode. From the terminal run:
Code:
cat /proc/sys/vm/laptop_mode
If it reports 0, laptop mode is off. If it reports 2, laptop mode is on. To turn on laptop mode run:
Code:
sudo laptop_mode
Also, see this thread:
http://ubuntuforums.org/showthread.php?t=994598
Edit /etc/default/acpi-support and /etc/laptop-mode/laptop-mode.conf as described in that thread.

Last edited by tommcd; 12-04-2008 at 05:48 AM.
 
Old 12-04-2008, 08:51 AM   #3
Tomás Ó hÉilidhe
LQ Newbie
 
Registered: Feb 2008
Location: Southeast Asia (sunny!)
Distribution: Xubuntu
Posts: 28

Rep: Reputation: 15
Here's what I get when I type "free -m":

Code:
             total       used       free     shared    buffers     cached
Mem:           999        609        390          0         22        270
-/+ buffers/cache:        317        682
Swap:            0          0          0
I have an entire gigabyte of RAM and I don't see myself using all of that within the next 5 years. One day, as an experiment under Windows XP, I opened up a ridiculous amount of programs to see if I could max out my RAM. I had Firefox playing 5 Youtube videos at once. I had every program of Microsoft Office open three times. I opened a few more programs, stuff like Adobe Acrobat. Then I opened Windows Media Player and played a video file.

I topped out at about 700 MB and realised that I'd never actually use that much RAM, so I'm happy with my gigabyte and I'm happy not having a swap file.
 
Old 12-04-2008, 03:32 PM   #4
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by Tomás Ó hÉilidhe View Post
I have an entire gigabyte of RAM and I don't see myself using all of that within the next 5 years.
By today's standards, 1G is not very much. If you continue to update your Linux installations, I think you'll hit the wall there before 5 years. Yes, you'll probably be fine using 1G for 5 years, but I wouldn't bet you won't be using your swap to some degree, unless you use one of the small WMs.
 
Old 12-05-2008, 03:30 AM   #5
Person_1873
Member
 
Registered: Sep 2007
Location: Australia
Distribution: Gentoo / Debian / Rasbian / Proxmox
Posts: 519

Original Poster
Rep: Reputation: 44
to clarify, this system isnt exactly a laptop, all it's internals are desktop standard, it is however in a laptop style case and easily portable, it's what's known as a "desknote" ie. a cross between a desktop and a notebook
 
Old 12-05-2008, 03:33 AM   #6
Person_1873
Member
 
Registered: Sep 2007
Location: Australia
Distribution: Gentoo / Debian / Rasbian / Proxmox
Posts: 519

Original Poster
Rep: Reputation: 44
problem solved, the clicking sound was a CPU fan that was about to die, as it is now dead
 
Old 12-05-2008, 03:49 AM   #7
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
swap priority can be set from swapon
 
Old 12-05-2008, 11:16 PM   #8
Person_1873
Member
 
Registered: Sep 2007
Location: Australia
Distribution: Gentoo / Debian / Rasbian / Proxmox
Posts: 519

Original Poster
Rep: Reputation: 44
what would the command look like?
 
Old 12-05-2008, 11:19 PM   #9
Person_1873
Member
 
Registered: Sep 2007
Location: Australia
Distribution: Gentoo / Debian / Rasbian / Proxmox
Posts: 519

Original Poster
Rep: Reputation: 44
i dont have any swap on my main system as i have 2GB of RAM i consider it unnecessary, but this desknote only has a single core 2.6Ghz processor and 768MB of RAM, it struggles with screen-savers lol
 
Old 12-06-2008, 03:45 AM   #10
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
swapon -p
man swapon
 
Old 12-06-2008, 04:00 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Irrelevant - that priority only determines the order that multiple swap extents will be used.
 
Old 12-06-2008, 09:50 AM   #12
j.todd
Member
 
Registered: Feb 2008
Location: Michigan
Distribution: Debian GNU/Linux Unstable
Posts: 144

Rep: Reputation: 16
Change the swappiness. Here is a link for changing it, as well as some other things; even though it's written for sidux, it should apply to almost all Debian-based distros.
 
  


Reply

Tags
priority, ram, swap



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When SWAP and RAM are out syberdave Linux - General 6 01-07-2006 12:13 AM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 12:57 PM
Use RAM as swap??? oneandoneis2 Linux - General 3 08-19-2004 04:48 AM
No SWAP but all RAM!! hari_seldon99 Linux - General 3 01-13-2004 10:48 AM
why swap should be twice of RAM? whitefox Slackware 17 04-19-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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