Program received signal: EXC_BAD_ACCESS.
sharedlibrary apply-load-rules all
No memory available to program now: unsafe to call malloc
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Cannot access memory at address 0x7fff5afb3618)
This looks a general program problem, other than specific MKL question. When I tested some simple code, it looks that such size of malloc could work well. I just test with the following code:
ptr_x = malloc(i)
print *, ptr_x
end program test_malloc
In your code, does it have other large memory allocation, which already uses most of the memory space? Also is it a 64 bit application, or 32 bit?
In addition to answers to Chao's questions if you could provide additional details, it would help us tobetter understand the issue you communicate and ways for its resolution:
1. your environment: OS, Fortran (compiler) version,CPU,its mode, IA-32 or Intel 64, Intel MKL version
2. compiler switches you use to build the application
3. short description of the computations you do (for example, compute mean and variance for a dataset of 1 million double precision numbers). If you could provide a short test case that would be even perfect.
function Theil(rev,NNum) result(T)
integer, intent(in) :: NNum
real ts(NNum), AS(NNum)
real T, mean, nnul
if (AS(i).gt.0) then
nnul=nnul+1 ! Count number of products
! Compute the mean
mean = sum(AS)/(max(1,nnul))
! Initialize Theil index
! Calcuate the summation values
ts(k) = (AS(k)/mean)*(log(AS(k)/mean))
end function Theil
/* Maximum heap request the heap manager will attempt */
#define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0
#define _HEAP_MAXREQ 0xFFFFFFE0
As you can see even on a 32-bit system it can allocate big chunks of memory. But, in areal life situation is
very different.For example, on a 32-bit system it couldn't allocate more than 1.09GB in a single call. That
is really strange and it puzzles me for a long time!
In your case a76MB of memory blockis well below 1.09GB limit ( a vector of size of ~146,000,000 double-precision elements ).