From: Patrik J. <pa...@uc...> - 2006-09-11 18:15:39
|
Anirban Banerjee wrote: > Hello everyone, > Newbie here :) . I'm trying to create a 4D array > with 151X151X151X151 float elements. When I run the code, I get an > error, and using gdb I see the following messages. > > I'm using Array <float, 4> ford(151,151,151,151); to declare the > array. I'm not doing anything fancy after this. But the execution > stops when it hits this declaration. I think its possibly a memory > allocation error. If anyone has come across something similar, cold > you please let me have a pointer as to how to get around this problem. > Any help would be greatly appreciated. Hi Anirban, get more memory or reduce the array size. This array will have 500 million elements at 4 bytes each which adds up to roughly 2GB of memory. So unless you have >>2GB memory on your system, you will get a bad_alloc.= cheers, /Patrik |