Re: Out Of Memory conditions


Subject: Re: Out Of Memory conditions
From: Sam TH (sam@uchicago.edu)
Date: Sat Feb 03 2001 - 05:04:49 CST


On Sat, Feb 03, 2001 at 11:57:55AM +0100, Mike Nordell wrote:
> I just come to think of another, non-exception using, solution to our
> (currently imaginary since it has never occured AFAIK, but still) OOM
> condition.
>
> We can provide code that on "new"-requested OOM calls calls our emergency
> save. This of course requires the emergency save not to use any heap-memory
> allocation, but I'm quite confident it already meets this requirement (how
> on earth would it otherwise be able to save upon SEGV?).
>
> We need to call either set_new_handler (for conforming compilers) or it's
> underscore prepended counterpart MSVC.
>
> I believe this should be done at the earliest possible moment in
> main/WinMain or whatever your platforms startup code is called. What's your
> view on this? Should we bother, or should we simply die if OOM occurs?
>

Well, you said that abort() is what gets called on an uncaught
exception. I *think*, and I may well be wrong, that the Unix signal
handling code currently catches abort. However, even if it doesn't,
it can. Then we wouldn't need to worry about this (on machines with
POSIX signals). It still seems like a reasonable idea for windows.
           
        sam th
        sam@uchicago.edu
        http://www.abisource.com/~sam/
        GnuPG Key:
        http://www.abisource.com/~sam/key




This archive was generated by hypermail 2b25 : Sat Feb 03 2001 - 05:04:33 CST