Q: What can you do when you get an std::bad_alloc exception?
A: Scott Meyers suggested overloading operator new and new-handler. I guess in financial apps it’s rarely needed. But we should really read the [[safe c++]] book written by a hedge fund coder.
A: I used to keep 60MB files in my C: drive, to be deleted when I run out of disk — same idea expressed in Item 7 in [[effC++]]
A: if it’s stack, it’s often due to deep recursion. You can set stack size —
gcc -Wl,–stack=xxxxx -Wl,–heap=yyyyy …