473,411 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

std::bad_alloc in low memory conditions

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 '06 #1
4 2969
sn****@gmail.com 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...
Nov 17 '06 #2

Victor Bazarov wrote:
sn****@gmail.com 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 '06 #3
:
>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
Nov 17 '06 #4
On 17 Nov 2006 10:01:03 -0800, sn****@gmail.com 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
Nov 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Asfand Yar Qazi | last post by:
Hi, Just wondering, if I do a: std::set_new_handler(std::terminate) I won't have to worry about a std::bad_alloc being thrown when I do a 'new ...' or a 'new(nothrow) ...', right? Its...
24
by: Marcus Kwok | last post by:
Hello, I am working on cleaning up some code that I inherited and was wondering if there is anything wrong with my function. I am fairly proficient in standard C++ but I am pretty new to the .NET...
5
by: Gary Wessle | last post by:
Hi I am getting this error when running a very similar code like the below, it is made for illustration only. thanks *************************************** **************** error...
14
by: Mohsen | last post by:
Hello everyone, In my program, I have to define many pointers and when I want to compile my program (in UNIX), it gives me the following error: terminate called after throwing an instance of...
3
by: schizoid_man | last post by:
Hi, I have the following code snippets and I get a std::bad_alloc error where I think there should be none. I've attached the relevant bits of the base class, derived class and the .cpp file...
4
by: daroman | last post by:
Hi Guys, i've problem with my small C++ programm. I've just small template class which represetns a array, everything works fine up to combination with std::string. I did tried it with M$ VC++ and...
4
by: Alerion | last post by:
Hello everyone, I've been a regular of this forum but this is my first post, generally I can find the answer to my question already, but this time I'm having a somewhat specific problem. For...
3
by: Sendil kumar | last post by:
Hi All, Problem Stetement:I have a problem in getting stack trace when I ues std::exception. In my code, I allocate virtual memory for certain kind of processing and will throw the...
16
upadhyad
by: upadhyad | last post by:
Hi everyone !! i have an interesting problem...hope you people can help. I am coding in C. the code is posted below: here I have a structure with two character vectors. I have to characters....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.