Need help with std::bad_alloc
I have been working on c++ project. My project is big in size. I have added new algorithm to it. The program goes upto few clock cycles and after that it cannot dispatch more instruction and so it goes into timeout(defined in program) or it gives me strange error that says "terminate called after throwing an instance of 'std::bad_alloc' what(): ".
I am using c++ vector here. My program works fine without the added new algorithm but with the added part, I am not sure if has memory allocation problem or not. However I think my algorithm is correct. I also tried the program by removing some portion of that algorithm and it goes upto more instructions than before and then goes in timeout. I really think it is a memory allocation problem, but I am not sure how to solve it as I am still learning C++. I use g++ compiler on linux.
If anybody has any idea, Please let know. Any help is greatly appreciated.