malloc causing vm_allocate errors
malloc causing vm_allocate errors
- Subject: malloc causing vm_allocate errors
- From: "Omar Awile" <email@hidden>
- Date: Wed, 4 Jul 2007 17:23:29 +0200
Dear Darwin users/developers
I am very new to Darwin so please excuse my question if the answer is obvious...
I first try to explain the situation and what I am trying to do, then
I'll explain what exactly the problem is:
I have a program which uses depending on the input between 1 and 2 gb
of memory. The program is tested on linux for the same dataset and
works without any problem there.
The target system where the problem occures is a Mac pro with 2 core
duo 2 processors (i think) and 4 gb of physical main memory. The OS is
a recent mac os x (I have only ssh access to the computer so I cannot
access any gui tools and don't know how to get system information in
console).
I have also checked ulimit where I have not found any memory constraints set.
My program contains somewhere following code
grid = (double***)malloc(Nx*sizeof(double**));
for (i = 0; i < Nx; i++) {
grid[i] = (double**)malloc(Ny*sizeof(double*));
for (j = 0; j < Ny; j++)
grid[i][j] = (double*)malloc(Nz*sizeof(double));
}
With the dataset in question this code will allocate about 1.1gb (in
linux, i386 & amd64) without complaining a bit.
Running the same code in darwin results in a ton of identical messages:
renyi(8200) malloc: *** error: can't allocate region
renyi(8200) malloc: *** set a breakpoint in szone_error to debug
renyi(8200) malloc: *** vm_allocate(size=8421376) failed (error code=3)
I don't understand why this error happens and what I have to do to get
rid of that error.
I hope someone can give me a solution, or at least a few hints.
cheers,
Omar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden