Re: Overcommitable memory??

From: Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Date: Sat Mar 18 2000 - 17:44:50 EST


"Matija Nalis" <mnalis@jagor.srce.hr> said:

[...]

> 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).

If you don't allow the first fork(2), the simulation won't be able to
lpr(1) to print out it's results. Or would go down, without a chance to
show it will _not_ touch 400Mb in the child.

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

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