std::bad_alloc in low memory conditions

Discussion in 'C++' started by sndive@gmail.com, Nov 17, 2006.

  1. Guest

    Do linux kernels 2.4 and 2.6 have some stash of memory set aside to
    handle paging in std::bad_alloc
    or ... exception handling code when new or new[] throws that exception?
    How is that handled? Does gcc generate some report to the elf loader
    that the largest exception
    handling section is x kb long or what?
     
    , Nov 17, 2006
    #1
    1. Advertising

  2. wrote:
    > Do linux kernels 2.4 and 2.6 have some stash of memory set aside to
    > handle paging in std::bad_alloc
    > or ... exception handling code when new or new[] throws that
    > exception? How is that handled? Does gcc generate some report to the
    > elf loader that the largest exception
    > handling section is x kb long or what?


    This is OT in comp.lang.c++ since your question is platform-specific.
    Just thought you might want to know...
     
    Victor Bazarov, Nov 17, 2006
    #2
    1. Advertising

  3. Guest

    Victor Bazarov wrote:
    > wrote:
    > > Do linux kernels 2.4 and 2.6 have some stash of memory set aside to
    > > handle paging in std::bad_alloc
    > > or ... exception handling code when new or new[] throws that
    > > exception? How is that handled? Does gcc generate some report to the
    > > elf loader that the largest exception
    > > handling section is x kb long or what?

    >
    > This is OT in comp.lang.c++ since your question is platform-specific.
    > Just thought you might want to know...


    I think this is a very comp.lang.c++ answer.
     
    , Nov 17, 2006
    #3
  4. :

    >> This is OT in comp.lang.c++ since your question is platform-specific.
    >> Just thought you might want to know...

    >
    > I think this is a very comp.lang.c++ answer.



    You obviously haven't been to comp.lang.c...

    --

    Frederick Gotham
     
    Frederick Gotham, Nov 17, 2006
    #4
  5. On 17 Nov 2006 10:01:03 -0800, wrote:
    > ... exception handling code when new or new[] throws that exception?
    >How is that handled?


    OOM is usually handled with a new handler. See also:
    http://www.gotw.ca/publications/mill16.htm

    Best wishes,
    Roland Pibinger
     
    Roland Pibinger, Nov 17, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page