lkml.org 
[lkml]   [2000]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Overcommitable memory??
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:57    [W:4.253 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site