Hello, Martin wrote:
> I have a program compiled with g++ 4.1.3 on Ubuntu 7.10. I frequently > get std::bad_alloc exceptions from new when trying to allocate a > couple of thousand objects of around 160 bytes each. According to top, > my program uses about 30 MB of memory when I get the exception, and > there is 1 GB of memory available. Can someone explain why I get a > bad_alloc under such circumstances? You have to be much more specific to get more than guesswork. Copy your project, and try to reduce it to the minimum code still showing the problem. Ideally you find the problem yourself in the course, otherwise the code is probably simple enough that you can get help here posting the code so the problem can be reproduced. Try running the program with valgrind to find many kinds of memory-related problems easier. Bernd Strieder _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus