Re: Overcommitable memory??

From: Matija Nalis (mnalis@jagor.srce.hr)
Date: Fri Mar 17 2000 - 20:20:40 EST


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??":
>> On Wed, 15 Mar 2000, David Whysong wrote:
>
>>> The only possibilities are to (a) enforce hard memory limits with no
>>> overcommit, thereby wasting large amounts of swap space that will never
>>> get used while not really solving the problem,
>
>> 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 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).

-- 
Opinions above are GNU-copylefted.

- 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:23 EST