Re: Avoiding OOM on overcommit...?

From: Marco Colombo (marco@esi.it)
Date: Fri Mar 31 2000 - 12:46:37 EST


On Fri, 31 Mar 2000, Rik van Riel wrote:

> On Fri, 31 Mar 2000, Marco Colombo wrote:
>
> > On the other side, you know most of the processes you're going to run
> > have a large address spaces but a small working-sets. Here your VM is
> > mostly swap, so suppose you have 64MB of RAM and 256MB of swap.
> > On sych a system, RAM is used always as a kind of cache, for process pages.
> > (Of course, it's used as a cache for FS blocks, too).
> > If you let processes allocate more that 256MB of VM, you're reducing
> > the cache size, and effectiveness. On such a system it makes sense
> > NOT to include RAM in the VM counts (just like you don't include RAM
> > in counts for available disk space...).
>
> Indeed. We _need_ memory for the kernel and for caching of
> executables. Maybe we should reserve something like
> min(ram_size / 2, swap_size / 2) for kernel memory and
> cache...

Speaking of reserving memory...

how difficult is to implement a configurable upper limit for total VM?

Something like: /proc/sys/vm/total_VM

Just setting it, the admin could tune memory reservation, or turn on
wild overcommitting:

echo "1024M" > /proc/sys/vm/total_VM

on a 64MB+256MB system *will* overcommit.

echo "256M" > /proc/sys/vm/total_VM

will reserve 64MB of RAM for caching (and kernel internal) purposes.

total_VM should be of course the sum of all address spaces of all
processes + kernel.

Address spaces mapped with mmap(..., MAP_SHARED, PROT_READ, ...)
from files should not be counted (no real VM gets allocated to them,
RAM is used again as a cache for file data).

Reserving space for kernel usage is done anyway by the low-watermark
limit... and AFAIK, the kernel address space can't be swapped.

>
> regards,
>
> Rik
> --
> The Internet is not a network of computers. It is a network
> of people. That is its real strength.
>
> Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies
> http://www.conectiva.com/ http://www.surriel.com/
>

.TM.

-- 
      ____/  ____/   /
     /      /       /			Marco Colombo
    ___/  ___  /   /		      Technical Manager
   /          /   /			 ESI s.r.l.
 _____/ _____/  _/		       Colombo@ESI.it

- 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 : Fri Mar 31 2000 - 21:00:29 EST