Re: Endless overcommit memory thread.

From: Khimenko Victor (khim@sch57.msk.ru)
Date: Fri Mar 24 2000 - 21:14:20 EST

  • Next message: David Whysong: "Re: Avoiding OOM on overcommit...?"

    In <20000325013345.A25723@vestdata.no> Ragnar Kjœrstad (kernel@ragnark.vestdata.no) wrote:
    > On Fri, Mar 24, 2000 at 11:22:40PM +0000, Mark Zealey wrote:
    >> > If an application allocates a large amount of memory and then
    >> > does not use it, is the app not broken as designed? I say FIX
    >> > THE APPLICATION!
    >>
    >> What about malicious users, viruses etc... I don't think that it's right
    >> to have a badly designed program bring down the entire system.

    > That's not what he suggested. He suggested that malloc should fail if
    > there is not enough memory/swap.

    > To me it sounds like a good idea. An important process (like syslog) can make
    > sure it will not be killed by just mallocing the memory it needs on
    > startup.

    You CAN do this from userspace. Not even changes in [g]libc are needed. Just
    use calloc instead of malloc ...

    P.S. And it'll not change anything significally: task still can be killed when
    stack can not be expanded (and no, to reserve 8MiB of RAM for each and every
    app is BAD idea).

    -
    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 24 2000 - 22:28:08 EST