C in NetBeans - debugger or startup won't stop, no error or error message

I am using NetBeans in my C program, and when I try to allocate memory for a 3D array, the program just stops: nothing happens, netbeans is no longer responding, but there is no error message.

The code is like this, the numbers are set at runtime:

int ***my_matrix, i;
my_matrix = malloc(sizeof(int**)*1);
my_matrix[0] = malloc(sizeof(int*)*45169);
for(i=0; i < 45169; i++) {
   my_matrix[0][i] = malloc(sizeof(int)*43604);
}

      

After the for loop, nothing else happens.

Is it a memory problem? I already increased a bunch of space in NetBeans in the file netbeans.conf

with the added argument (and restarted NetBeans):

-J-Xmx2048m

in the netbeans_default_options part.

I don't know what to do, or where the problem might be.

My operating system is OS X and NetBeans is version 8.0

+3


source to share





All Articles