Posted on 2009-12-18
I am getting random St9bad_alloc exceptions when trying to create a vector of floats that is sized at 16M (64MB) from many threads. I have gone through a number of tests and system parameters and cannot seem to figure out the cause. At first, the problem was happening quite often, until I noticed the stacksize limit was low low. I changed the stacksize and heapsize to unlimited and tried again. This time, the error occurs much less often. I monitored the system memory being used, and swap is not being used at all, and main memory still has 1.5GB free. Any ideas on what would cause this? Please let me know if you need more information. Thanks for the help!