Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.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 22:49:45
In Reply to: [gentoo-user] To swap or not to swap? Is it really needed? by "Claudio Roberto França Pereira"
1 On Thu, 29 Dec 2011 20:34:16 -0200
2 Claudio Roberto França Pereira <spideybr@×××××.com> wrote:
4 > I've run my box with 2x2GB of RAM for a while, but a couple weeks ago
5 > one of my chips died, and now I'm stuck with 1x2GB. That's not that
6 > terrible, I'm using Gentoo all day, rarely switching to Windows 7
7 > anyways, who really likes RAM.
8 > Anyway, for the last days, my machine has been really slow, with mouse
9 > lag, input delay, and other things. I imediately associated it to the
10 > lack of free RAM, but I always rushed to check the RAM usage with htop
11 > and it were never really high. So today I decided to turn my swap
12 > partition off. And the system is FLYING. I mean, it's pratically a new
13 > machine, now it's usable and reliable.
14 >
15 > I thought of falling back from KDE 4 to awesome (tried it earlier in
16 > an old notebook last year) given the memory footprint of KDE, but it
17 > seems that my hard disk was the culprit here.
18 > I've heard that Linux need a little swap partition, maybe just 512MB,
19 > for some tasks, but I'm not going to turn it on anytime soon. It's a
20 > desktop machine, 24/7, and I couldn't care less about suspend-to-disk.
21 >
22 > So, should I ban swap partitions entirely from my life? Is that ok?
26 This question comes up about every three months or so, and the end
27 result is always the same: the same people chip in with the same
28 answers and we all come to the same conclusion.
30 You should check the Gentoo archives for the most recent gigantic
31 thread on this, that one was particularly illuminating.
33 But to summarize:
35 You haven't given any real info for people to answer your actual
36 question. To do that, we need to know what exactly your machine is
37 doing and why, please what your swap settings are.
39 Generally, the kernel is happiest with a little bit of swap (512 MB is
40 a very much more than a little) and you can get by with that if your
41 apps fit into ram. KDE is reasonably smart with ram usage, if you only
42 have 2G it will try fit into that. If you have 22G it will try to use
43 lots.
45 If your machine was really slow, it was likely thrashing. But no-one
46 can say for sure - what was your disk doing at the time? What did
47 vmstat say was going on?
49 To summarize a summary, the answer to "can I ban swap?" is "maybe"
53 --
54 Alan McKinnnon
55 alan.mckinnon@×××××.com


Subject Author
Re: [gentoo-user] To swap or not to swap? Is it really needed? "Claudio Roberto França Pereira" <spideybr@×××××.com>