I was writing code for a program in which i used malloc. When i ran that code it showed Run Time Error (SIGSGV). I was trying to allocate around 30,000 int dynamically (int *scratch = (int *)malloc(10000 * sizeof(int));). Adding to this i am also using merge sort which runs recursively and 10,000 elements will be sorted. Is it due to the malloc which is trying to allocate dynamic memory or the recursion?
Another problem related to this. I was created a double link list and was using malloc for creating new nodes. The problem states that there could be 150000 elements ( ranging from 1-200). So to store that i used short int (2 bytes). Now this much of dynamic allocation of memory could be a problem?? I am still getting SIGSEGV error for this program too. Could this much of usage of memory during run time create this error??
Thanks in advance.