1 |
Hi Juan, |
2 |
on Tue, Aug 12, 2008 at 05:18:53AM -0300, you wrote: |
3 |
>> If I follow this advice, what happens when I compile something like |
4 |
>> Open Office which allocates 3-4GB in /var/tmp during compilation and |
5 |
>> I only have 2GB physical RAM in the computer? |
6 |
> |
7 |
> If all the Virtual Memory (VM = RAM+SWAP) is exhausted the kernel will try |
8 |
> to kill the process that is consuming most of it. |
9 |
|
10 |
That's why tmpfs also uses swapspace. Given the address space you have |
11 |
on a 64bit system, I don't see any reason[0] to save swapspace any |
12 |
more---after I tried the tmpfs idea for the first time, I just |
13 |
repartitioned my system for 32 GiB of swap and put /tmp and |
14 |
/var/tmp/portage on tmpfs. Just perfect. |
15 |
Not only does this speed up everything that uses temporary files, it |
16 |
also minimizes the effect of programs that fragment or leak their |
17 |
memory, like FF2 that had a habit of packing small cached things after |
18 |
big ones and then not reusing the big ones after they had been freed and |
19 |
thus ballooning to perverse sizes. I've seen a Firefox grow to over 10 |
20 |
GiB (at 4 GB physical RAM) with minimal impact on the rest of the system |
21 |
because the hardly ever touched pages just get paged out at some point |
22 |
and don't matter as long as they stay on disk. |
23 |
|
24 |
cheers, |
25 |
Matthias |
26 |
|
27 |
[0] OK, there is small overhead due to larger page tables but it's |
28 |
negligible. |
29 |
-- |
30 |
I prefer encrypted and signed messages. KeyID: FAC37665 |
31 |
Fingerprint: 8C16 3F0A A6FC DF0D 19B0 8DEF 48D9 1700 FAC3 7665 |