Hi everyone;
Unexpectedly I am receiving a dynamic memory allocation error in my code when running on a Mac OS X (10.5), while that does not happen when I compile and execute the same code on a linux x86.
the error is the following (one for each memory allocation call):
...
testing.exe(13762) malloc: *** mmap(size=2132258816) failed (error code=12)
*** error: can't allocate region
...
and the lines of the code are wrapped below.
Where could the problem be? I report my memory allocation lines here below
thanks in advance
S.M.
The problem is the same either using malloc or calloc (with their respectively syntax)
1) option 1 with calloc:
Code:
_esup1 = (int*) calloc(1,sizeof(int));
_esup2 = (int*) calloc(nnodes+1,sizeof(int));
_nesup = (int*) calloc(nnodes+1,sizeof(int));
_lpoin = (int*) calloc(nnodes+1,sizeof(int));
_psup2 = (int*) calloc(nnodes+1,sizeof(int));
_npsup = (int*) calloc(nnodes+1,sizeof(int));
2) option with malloc:
Code:
_esup2 = (int*) malloc((nnodes+1)*sizeof(int));
_nesup = (int*) malloc((nnodes+1)*sizeof(int));
_lpoin = (int*) malloc((nnodes+1)*sizeof(int));
_psup2 = (int*) malloc((nnodes+1)*sizeof(int));
_npsup = (int*) malloc((nnodes+1)*sizeof(int));