I am unable to allocate memory using the following code:
int *h_VC = (int *)malloc(sizeof(int)*SIZE); //SIZE is 19200 if(h_VC==NULL) { printf("Memory Not avaialble"); } My code uses the above block in a while loop and is run several times. I have 8GB memory. I am monitoring the free memory at the same time when running the code.
The memory allocation is failing although i have arround 3GB of free memory left.
What could be the problem?
malloc. Theres no need to and it is possibly dangerous.