1 |
2008/8/12 Juan Fco. Giordana <juangiordana@×××××.com> |
2 |
|
3 |
> Morgan Wesström wrote: |
4 |
> |
5 |
>> If I follow this advice, what happens when I compile something like |
6 |
>> Open Office which allocates 3-4GB in /var/tmp during compilation and |
7 |
>> I only have 2GB physical RAM in the computer? |
8 |
>> |
9 |
> |
10 |
> If all the Virtual Memory (VM = RAM+SWAP) is exhausted the kernel will try |
11 |
> to kill the process that is consuming most of it. Daniel Robbins explains |
12 |
> precisely that behaviour in this article: |
13 |
> |
14 |
> http://www.funtoo.org/en/articles/linux/ffg/3/ |
15 |
> |
16 |
> "So, the kernel mistakenly attacks the biggest VM-hog of a process it can |
17 |
> find, which is generally your X server if you happen to be running one. So, |
18 |
> your X server dies, and the root cause of the low-VM condition (tmpfs) isn't |
19 |
> addressed. Ick." |
20 |
> |
21 |
> See "Avoiding low VM conditions". |
22 |
> |
23 |
> |
24 |
if you're still using something the kernel won't kill nothing. the behaviour |
25 |
you're referencing is the kernel cached pages. when you use something you |
26 |
load it into memory. after you finish using it then the kernel will continue |
27 |
to hold the pages in ram as cached pages, if you have enough space to be |
28 |
able to speed up the eventual future reuse of that particular object. when |
29 |
the ram is over certain quota the kernel will free some pages based on |
30 |
different criteria like the oldness of the page or on how many times that |
31 |
particular page has been used. for example if you use libdvdcss to decode a |
32 |
dvd you'll have it in ram. let's assume that you then load another library |
33 |
and use that library 30 times. then you'll reuse libdvdcss again and then |
34 |
start a program that will consume quite some ram space, like openoffice. the |
35 |
kernel will free the libdvdcss from ram and cache it into the swap partition |
36 |
mantaining the other library into ram if possible, cause it has been used |
37 |
more than once. this is a mere and very simple example of how the kernel |
38 |
frees the ram space. |
39 |
as for processes that are in use, from my knowledge, the kernel will not |
40 |
kill anything unless the process doesn't reply to its interrupts. |
41 |
|
42 |
-- |
43 |
dott. ing. beso |