malloc对内存有限制么,请帮忙修改一个程序
如下程序,分配了12288次就执行不了,机器的内存有几十G,这是怎么回事
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define ARTICLE_S 12782
#define WORD_S 17547
int num_of_ulong(unsigned long i);
void error_and_die(const char *msg) {
perror(msg);
exit(EXIT_FAILURE);
}
//unsigned long v[WORD_S][ARTICLE_S];
int main(void){
unsigned long word,article;
unsigned long part,position;
unsigned long t;
unsigned long i,j,k;
unsigned long *v[ARTICLE_S];
for(i=0lu;i<WORD_S;i++){
v[i]=(unsigned long *)malloc(ARTICLE_S*sizeof(unsigned long));
printf("succ\n");
}
/**
* ......
}*/
for(i=0lu;i<WORD_S;i++){
free(v[i]);
}
}