Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] To swap or not to swap? Is it really needed?
Date: Thu, 29 Dec 2011 23:10:45
Message-Id: 4EFCF310.3050600@gmail.com
In Reply to: [gentoo-user] To swap or not to swap? Is it really needed? by "Claudio Roberto França Pereira"
1 Claudio Roberto França Pereira wrote:
2 > I've run my box with 2x2GB of RAM for a while, but a couple weeks ago
3 > one of my chips died, and now I'm stuck with 1x2GB. That's not that
4 > terrible, I'm using Gentoo all day, rarely switching to Windows 7
5 > anyways, who really likes RAM.
6 > Anyway, for the last days, my machine has been really slow, with mouse
7 > lag, input delay, and other things. I imediately associated it to the
8 > lack of free RAM, but I always rushed to check the RAM usage with htop
9 > and it were never really high. So today I decided to turn my swap
10 > partition off. And the system is FLYING. I mean, it's pratically a new
11 > machine, now it's usable and reliable.
12 >
13 > I thought of falling back from KDE 4 to awesome (tried it earlier in
14 > an old notebook last year) given the memory footprint of KDE, but it
15 > seems that my hard disk was the culprit here.
16 > I've heard that Linux need a little swap partition, maybe just 512MB,
17 > for some tasks, but I'm not going to turn it on anytime soon. It's a
18 > desktop machine, 24/7, and I couldn't care less about suspend-to-disk.
19 >
20 > So, should I ban swap partitions entirely from my life? Is that ok?
21 >
22 >
23
24 You may want to adjust how swap is being used. I have swap but only
25 want it used to prevent a lockup or some other bad situation. I have
26 this in /etc/sysctl.conf:
27
28 vm.swappiness = 20
29
30 With a setting of 20, it will use swap but only when it is out of ram.
31 I have 16Gbs of ram in my rig and I wouldn't run it without at least a
32 little swap. Why? Well not long ago I did a update. One of the KDE
33 programs got updated and I was still logged in. It wasn't happy and
34 starting eating ram like a cookie monster. That one program was using
35 over 14Gbs and growing. I was able to kill it before things got to bad
36 but even with 16Gbs of ram and swap, it was dog slow. Another minute or
37 two, it may have locked me out.
38
39 I would recommend having swap and just setting it to use it when ram
40 fills up. I would also replace that stick when I could too. ;-)
41
42 Dale
43
44 :-) :-)
45
46 --
47 I am only responsible for what I said ... Not for what you understood or how you interpreted my words!
48
49 Miss the compile output? Hint:
50 EMERGE_DEFAULT_OPTS="--quiet-build=n"