help-gplusplus
[Top][All Lists]
Advanced

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

Re: bad_alloc thrown but plenty of memory left


From: mliptak
Subject: Re: bad_alloc thrown but plenty of memory left
Date: Sun, 27 Apr 2008 23:40:24 -0700 (PDT)
User-agent: G2/1.0

On Apr 17, 1:17 pm, Martin <lovesl...@frustratedhousewives.zzn.com>
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 might be running out of memory that a process can allocate.. check
the output of command: ulimit -a.
m.


reply via email to

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