Re: Overcommitable memory??

From: Rask Ingemann Lambertsen (rask-linux@kampsax.k-net.dk)
Date: Sun Mar 19 2000 - 10:33:28 EST


Den 18-Mar-00 02:20:40 skrev Matija Nalis fĝlgende om "Re: Overcommitable memory??":
> On 17 Mar 2000 00:27:42 +0100, Rask Ingemann Lambertsen
> <rask-linux@kampsax.k-net.dk> wrote:
>>Den 15-Mar-00 11:49:45 skrev James Sutherland fĝlgende om "Re:
>>Overcommitable memory??":
>>
>>> As well as *destroying* performance (you'd effectively eliminate COW
>>> capability on fork - if your 500Mb simulation wants to fork a 100k mailer
>>> process to send you an update, the kernel has to allocate and copy 500Mb
>>> of RAM/swap first, then discard it all again.)
>>
>> Not at all. COW is a performance optimisation which does not depend on
>>overcommitment of memory in any way. Why would you want to turn it off?

> Say you have 800MB virtual RAM, and you simulation currently uses 500MB.
> And now, it tries to fork(2). Do you allow it, or does fork fail with
> -ENOMEM ?

   If you don't overcommit there is only once choice: Let it fail with
ENOMEM because there is not enough memory: 2*500MB > 800 MB.

> If you allow it, and one copy later just writes different data to
> say 400MB of itself, it will run out of memory (because system will need to
> create new page for COW, and would need 500MB+400MB, which is more than
> 800MB virtual RAM your machine have). Ka-boom, you process will die on
> simple memory access (no syscall to check error from, since you allowed that
> fork() which was last place to check it).

   That's why overcommitment of memory is a bad idea. It breaks programs
that do nothing wrong.

Regards,

/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻTŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\
| Rask Ingemann Lambertsen | E-mail: mailto:rask@kampsax.dtu.dk |
| Please do NOT Cc: to me or the | WWW: http://www.gbar.dtu.dk/~c948374/ |
| mailing list. I am on the list.| "ThrustMe" on XPilot, ARCnet and IRC |
| Shakespeare, C Version: (0x2B | ~0x2B) |

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:28 EST