help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bad_alloc thrown but plenty of memory left


From: Martin
Subject: bad_alloc thrown but plenty of memory left
Date: Thu, 17 Apr 2008 04:17:37 -0700 (PDT)
User-agent: G2/1.0

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]