Re: Overcommitable memory??

From: Rask Ingemann Lambertsen (rask-linux@kampsax.k-net.dk)
Date: Tue Mar 21 2000 - 15:29:40 EST


Den 20-Mar-00 14:19:28 skrev James Sutherland fĝlgende om "Re: Overcommitable memory??":
> On 20 Mar 2000 1:8:46 +0100, you wrote:

>> Actually, just having overcommitment turned off will itself tend to keep
>>a little memory free for someone to log in and sort out the situation.
>>Let's say the system is down to 500 kB of free memory (RAM+swap) and a
>>program requests 600 kB. Now, without overcommitment of memory, the
  ^^^^^^^^^^^^^^^^^^^^^^^^
>>allocation will fail and the system will still have 500 kB of free memory
  ^^^^^^^^^^^^^^^^^^^^
>>left, all your daemons will still be running, etc.

> No; malloc() still fails, because the 600K allocation exceeds free VM.
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   Why do we suddenly agree about this part? A misunderstading?

[cut]
>>2) An application accesses a part of its allocated address space and the
>>kernel can't handle it because all RAM and swap has been used. This can
>>only happen when the kernel has overcommitted memory. Short of suspending
>>the currently running process until memory is freed, there isn't much the
>>kernel can do except to kill a process and free memory that way.

> Why had the process allocated unused memory anyway?

   Like, because it never got a chance to use it after allocating it?

> In the normal case
> (allocate a buffer, then use it) overcommit never comes into play.

   Race condition. Linux is a multitasking system. Think of two or more
processes.

> It
> is only if you malloc() a fairly large buffer (a few K or more) and
> then do not use it until much later that there is a potential problem.

    Where "much later" can be anything from a timeslice and up. Even if you
memset() straight away, too bad Linux decided to give the CPU(s) to other
processes. Linux is a multitasking system.

   (We've been through the rest a couple of times already.)

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 |
| Packet radio - a true Ether net |

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