memory allocation problem

I am writing a program that requires some very large vectors. I keep getting bad allocation exceptions, despite the fact that there is plenty of memory available. According to Matlab, the largest contiguous memory block I have available is 998 MB--which is considerably more than my entire program is using when it crashes. Is there a way to request that the vectors use the largest available memory block? Or maybe rearrange memory when needed so that the vectors can be expanded? I have virtually no experience with memory management in C++ and the articles I've found online so far haven't been much help; so any input would be greatly appreciated. Thanks.
Store pointers in your vector instead of variables. This should reduce the amount of memory on the stack and move alot of the overhead to the heap allowing your more allocation.
Topic archived. No new replies allowed.