1 |
On Sun, 2011-01-16 at 14:41 -0800, Grant wrote: |
2 |
> >> I've been running without swap for quite a while, but my system goes |
3 |
> >> into a near freeze whenever I undertake a large emerge such as |
4 |
> >> chromium or openoffice. Is there anything I can do to prevent this |
5 |
> >> besides turning swap back on? I have 3GB RAM and MAKEOPTS="-j1". |
6 |
> >> |
7 |
> >> - Grant |
8 |
> >> |
9 |
> >> |
10 |
> > |
11 |
> > As Volker says, don't turn swap off. Make it small if you must, but |
12 |
> > keep some around. It's just disk space. |
13 |
> |
14 |
> I thought swap was no longer necessary on a machine with sufficient |
15 |
> memory. I guess I took I some bad advice a while back. |
16 |
|
17 |
The answer is that you have insufficient memory when emerging - hence |
18 |
swap is necessary - turn it on! ionice will help, but it is alleviating |
19 |
symptoms of lack of swap, not curing it. Downside in this case is |
20 |
slower emerges and some will still be flaky. |
21 |
|
22 |
You can use a temporary swapfile or swap over ndb for those special |
23 |
cases if you have no swap partition. Also check the tunable |
24 |
parameter /proc/sys/vm/swappiness to force memory to swap, or to get the |
25 |
kernel to be very reluctant to use swap - can give the benefits of no |
26 |
swap, but still have a safety margin with a small penalty when running |
27 |
low on memory. google for "/proc/sys/vm/swappiness" |
28 |
|
29 |
In short, swap is good, downside to swap is sometimes small pauses while |
30 |
pages are swapped back in. But not having swap forces the kernel to |
31 |
have a large overhead in trying to manage a low memory situation when it |
32 |
gets low such as during an emerge. No swap is ok if you have a system |
33 |
doing almost nothing, but with almost any normal use, 3G and no swap is |
34 |
going to be trouble at times. |
35 |
|
36 |
BillK |