[ale] how do I increase Linux swap file size?

Ron Frazier atllinuxenthinfo at c3energy.com
Mon Jan 17 21:33:46 EST 2011


Hello all.  At this moment, 6 of you have replied to my query about swap
file size.  This is sort of my reply to all.  First, I want to say
thanks to everyone for sharing the information you did.  This is all
very helpful and you guys are a great resource.  Here's essentially what
you said:

Collin Pruitt - Suggests gparted.  I'm going to be looking into the
features of this some more.

Chuck Payne - Provided a link to an article about setting up a swap
FILE.  This looks very cool, and I'm definitely going to save that for
future reference.

Michael Warfield - Suggests gparted.  Same as above.

All this is good data, however, the best advice may be from the last
three.

John Scott, Michael Trausch, and Richard Faulkner - Essentially said
leave it alone and you don't or probably don't need this much swap.
Richard mentioned something else which I mention below.

This prompted me to do some testing.

I opened the following in Gnome under Ubuntu 10.04:

-- Evolution email, + 6 windows for messages
-- Firefox + 22 open tabs, mostly with images, one with Pandora music
service, streaming music
-- File Browser
-- Terminal
-- FXTrade - A Java based currency trading application which opens 12
small windows with charts, etc.  [ No, I'm not rich yet. 8-) ]
-- RSSOwl - A Java based RSS reader (while not updating feeds)
-- Eudora - Windows email client under Wine
-- System Monitor
-- GIMP - Photo editor, blank canvas
-- Open Office Writer, blank document
-- MetaTrader - Windows currency trading application under Wine

Now, granted, most of these apps are not particularly active, like video
editing or transcoding or simulations would be.  However, if you count
all the windows and tabs, I have about 51 things going on.  In my
original post, I said I have 8 GB RAM and 8 GB swap.

The CPU monitor applet in the panel says:

CPU (AMD Phenom 4 core): 23%
Memory: 33 % - Programs
Memory: 19 % - Cache
Swap: 0 % in use

And, the CPU cores are cruising along at 800 MHz instead of a possible
3.4 GHz.

Sooo ... I think I'll leave the swap as is.  The machine is barely
breathing hard.

For comparison, here are the stats for a 2002 vintage Toshiba laptop
with a Pentium 4 (single core) processor at 2.4 GHz, 1 GB RAM, and 8 GB
swap.

This one is also running Ubuntu 10.04, Gnome, and:

-- Firefox with 1 open tab
-- System Monitor
-- RSSOwl (while not updating feeds)

The CPU monitor applet in the panel says:

CPU (Pentium 4, single core): 25%
Memory: 66 % - Programs
Memory: 28 % - Cache
Swap: 0.9 % in use

The CPU in that one cannot scale, so it always runs at 2.4 GHz.  I think
I'll leave the swap as is here too.  This one will probably need it if I
run more than 3 apps.  

By the way, for an interesting experiment, start Pandora, or another
flash app, on an older computer like this.  Note the CPU usage.  Now
open another tab with anything or nothing in it, and make sure that tab
is selected and Pandora is not visible.  You will note a substantial
reduction in CPU usage.  I've proven with a power meter that this also
translates to power usage.  I find that fascinating.

Finally, Rich mentioned that I might need more swap space if I use
Hibernate.  I do on occasion, and the UPS will if the battery is low.
If anyone knows anything about that, please let me know.

Thanks again for the help.

Sincerely,

Ron

-- 

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new messages very quickly.)

Ron Frazier

770-205-9422 (O)   Leave a message.
linuxdude AT c3energy.com



More information about the Ale mailing list