help-gplusplus
[Top][All Lists]
Advanced

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

Re: std::bad_alloc


From: Paul Pluzhnikov
Subject: Re: std::bad_alloc
Date: Mon, 14 Aug 2006 17:31:57 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Gary Wessle <phddas@yahoo.com> writes:

> I am getting this error when running a very similar code like the
> below, it is made for illustration only.

Good for you.
Did you have a question we can help you with?

Guessing that the question was "why does it crash like that?",
the answer is:

- either it ran out of memory (it is failing to allocate 
  27.5 million of "fxpair"s, which could be a lot of bytes,
  depending on how big each fxpair is), or

- you have corrupted heap.

Since you are apparently on Linux, you can try running your program
under Valgrind.

If it is VG-clean, and isn't supposed to be allocating 27 million
fxpair's, then look for algorithmic errors.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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