Top "Bad-alloc" questions

std::bad_alloc is the type of exception thrown when memory allocation fails in a C++ program

How to deal with bad_alloc in C++?

There is a method called foo that sometimes returns the following error: terminate called after throwing an instance of 'std::…

c++ memory-management bad-alloc
"std::bad_alloc": am I using too much memory?

The message: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc I looked at the …

c++ bad-alloc
Debugging strategy to find the cause of bad_alloc

I have a fairly serious bug in my program - occasional calls to new() throw a bad_alloc. From the …

c++ debugging bad-alloc
Is it okay to manually throw an std::bad_alloc?

I have this code.. CEngineLayer::CEngineLayer(void) { // Incoming creation of layers. Wrapping all of this in a try/catch block …

c++ new-operator throw bad-alloc
How can I debug St9bad_alloc failures in gdb in C?

I have a program failing with: terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc …

c++ c debugging gdb bad-alloc
C++ vector std::bad_alloc error

I'm trying to implement a suffix tree in c++ while adding nodes to my vector list, it throws std::bad_…

c++ vector bad-alloc
C++ Exception: bad_alloc at memory location

Unhandled exception at at 0x7650C41F in binary.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x003…

c++ exception memory visual-studio-2012 bad-alloc
Why am I getting "Invalid Allocation Size: 4294967295 Bytes" instead of an std::bad_alloc exception?

I wrote the following piece of code to allocate memory for an array: try { int n = 0; cin >> n; …

c++ arrays memory-management bad-alloc
`std::vector` throws a "bad allocation" exception when resized

I have the following code in a C++ dll, which I invoke through JNI: std::vector<double> myVector; …

c++ java-native-interface stdvector bad-alloc