I have a C program that calls "calloc" to get clean memory and then frees it when no longer needed.
About 95% of the time, the program runs fine and seems to be correct.
About 5% of the time, it IMMEDIATELY crashes with the following error
malloc: *** mmap(size=3568361472) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
I don't call malloc directly (though calloc calls malloc) and I certainly am never asking for 3.5Gb of space, so somehow the whole request seems to have gone awry.
If I simply run the program again, making no changes to anything, then it usually works the next time, so it appears to be a RANDOM and TRANSIENT error.
Nevertheless I would prefer to know why it is doing this, and how it can be stopped..
I am using
gcc (GCC) 4.2.2
Copyright (C) 2007 Free Software Foundation, Inc.
on an Intel Mac running MacOS X 10.5.5
Thanks
Gordon
About 95% of the time, the program runs fine and seems to be correct.
About 5% of the time, it IMMEDIATELY crashes with the following error
malloc: *** mmap(size=3568361472) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
I don't call malloc directly (though calloc calls malloc) and I certainly am never asking for 3.5Gb of space, so somehow the whole request seems to have gone awry.
If I simply run the program again, making no changes to anything, then it usually works the next time, so it appears to be a RANDOM and TRANSIENT error.
Nevertheless I would prefer to know why it is doing this, and how it can be stopped..
I am using
gcc (GCC) 4.2.2
Copyright (C) 2007 Free Software Foundation, Inc.
on an Intel Mac running MacOS X 10.5.5
Thanks
Gordon