Hi All,
I am trying to use malloc function to allocate memory for 580,000,000 numbers (long int).
valid = 580000000;
infoBuffer = malloc((valid)* sizeof(long));
if(!infoBuffer)
printf("Allocat ing memory failed\n");
else
printf("Success ful memory allocation\n");
I have all these numbers in a file.
I am using my C code to load these numbers to the buffer so that I can use them to calculate something.
The memory allocation fails, but when I lowered the number to 520,000,000 it successfully loads them to memory, which tells me the limitation is 520,000,000. (i tried 521,000,000, it fails)
I tried this on a 4GB RAM machine and also on a 64 bit machine but all in vain (limitation 520,000,000 for all of them).
By the way my machine is 1GB.
I am using Visual C++.
Is this the limitation of VC++? or the malloc() ? Anything else?
Please advise me on any other function I can use to get this done.
I am trying to use malloc function to allocate memory for 580,000,000 numbers (long int).
valid = 580000000;
infoBuffer = malloc((valid)* sizeof(long));
if(!infoBuffer)
printf("Allocat ing memory failed\n");
else
printf("Success ful memory allocation\n");
I have all these numbers in a file.
I am using my C code to load these numbers to the buffer so that I can use them to calculate something.
The memory allocation fails, but when I lowered the number to 520,000,000 it successfully loads them to memory, which tells me the limitation is 520,000,000. (i tried 521,000,000, it fails)
I tried this on a 4GB RAM machine and also on a 64 bit machine but all in vain (limitation 520,000,000 for all of them).
By the way my machine is 1GB.
I am using Visual C++.
Is this the limitation of VC++? or the malloc() ? Anything else?
Please advise me on any other function I can use to get this done.
Comment