LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   make ubuntu 8.04 use RAM before SWAP (https://www.linuxquestions.org/questions/linux-general-1/make-ubuntu-8-04-use-ram-before-swap-688026/)

Person_1873 12-03-2008 10:01 AM

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?

tommcd 12-04-2008 05:29 AM

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.

Tomás Ó hÉilidhe 12-04-2008 08:51 AM

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.

SlowCoder 12-04-2008 03:32 PM

Quote:

Originally Posted by Tomás Ó hÉilidhe (Post 3364315)
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.

Person_1873 12-05-2008 03:30 AM

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

Person_1873 12-05-2008 03:33 AM

problem solved, the clicking sound was a CPU fan that was about to die, as it is now dead

hasanatizaz 12-05-2008 03:49 AM

swap priority can be set from swapon

Person_1873 12-05-2008 11:16 PM

what would the command look like?

Person_1873 12-05-2008 11:19 PM

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

hasanatizaz 12-06-2008 03:45 AM

swapon -p
man swapon

syg00 12-06-2008 04:00 AM

Irrelevant - that priority only determines the order that multiple swap extents will be used.

j.todd 12-06-2008 09:50 AM

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.


All times are GMT -5. The time now is 12:30 PM.