Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 1999 18:53:24 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Brian Feldman <green@unixhelp.org>
Cc:        current@FreeBSD.ORG
Subject:   Re: swap-related problems
Message-ID:  <199904120153.SAA12154@apollo.backplane.com>
References:   <Pine.BSF.4.05.9904112100260.35407-100000@janus.syracuse.net>

next in thread | previous in thread | raw e-mail | index | archive | help
:I use the memory as soon as it's malloced. If it reserves a page, then
:pagefaults it into existence, the VM system knows that that page is now
:allocated. When I malloc the last available page for user use, the VM
:system knows that it's the last page. I dirty it, and there are none
:free. If I malloc(), I want to know that there is no more memory, not
:have my process killed. This is POMA.
:
:Previously, the POLA, a NULL getting returned, WORKED CORRECTLY. It did this
:for a long time. My little test program always showed this, and shows
:that now something was broken. I'll attach it to the end.

    I ran your program.  malloc() appears to work properly -- returns NULL when
    the datasize limit is reached.  In my case, I set the datasize limit 
    to 64MB and ran the program.

    ...
    mallocs failed at 64956

    Under 4.0-current.

:>     then one or two processes getting killed.  Having N random processes get
:>     malloc() failures can lead to serious instability with processes.
:
:Only bad code doesn't check return values of malloc().

    You are volunteering to run through the thousands of programs & ports
    to make sure that every one checks the return value for malloc()?

    Declarations that don't solve problems are not relevant.  It's bad enough
    that we have to kill something to handle an out-of-vm situation, we
    shouldn't go off and destabilize the rest of the system while we are at it.

						-Matt



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904120153.SAA12154>