You can not have 8 GByte as a single array in BCB6 !!! There are few reasons for this:
You are targeting 32 bit App
So your OS or emulator can not handle more then 2 or 4 GB of memory. That means 8GB is out of question no matter what you do. And yes even if you have x64 Windows OS your 32 bit app is running in WoW64 emulator ...
Borland allocation new
can't allocate single chunk above 1 GB
Not sure why as the limit should be near 2 or 4 GB but at least for me slightly above the 1GB (even if there is more then 2GB mem free WoW64) is the max limit for safe allocation. Possibly inherited limitation of Borland's memory manager from older versions. This behavior was tested on BDS2006 so not sure if BCB6 is the same but I see no reason why it should not as they share the same memory manager and related C++ engine bugs (which are not present in BCB5 btw).
And finally as you are using new,delete[]
you should check this out (just to be sure):
So you need to divide you array into more chunks. As you got 2D matrix so you can use array of arrays as Malcolm McLean suggest. So if cell of you array is T
try:
#define T double
T **m=new T*[13230];
for (int i=0;i<13230;i++) m[i]=new T[26460];
m[10000][20000]=1.2345; // do your stuff with m[][]
for (int i=0;i<13230;i++) delete[] m[i];
delete[] m;
Just change T
(I used double
as it is also 8 Byte) for your data type and add checking for new
returning NULL
If you really need to have 8GB matrix you need to store it in FILE. Or use 64 bit compiler like RAD2009 or newer.