Because of this, first of all, you really need to allocate a buffer that is larger than your RAM. I hope that you are running a 64-bit OS or that you have PAE enabled. If we say 4 GB of RAM, you need something like:
double* pBigArray = (double*)malloc(sizeof(double) * 536870912);
, RAM, . , . , , , .
, , .
, , :
double lfBigChecksum = 0.0;
while (true)
{
int iIndex = rand() % BUFFER_SIZE;
lfBigChecksum += pBigArray[iIndex];
}
8 4 , ( ).