测试一下你的进程中可以分配多大的内存。
#include <stdio.h>
#include <stdlib.h>
int main()
{
int MB=0;
while(malloc(1<<20))
++MB;
printf("Allocated %d MB total\n", MB);
return 0;
}
我的结果是1918MB。
测试一下你的进程中可以分配多大的内存。
#include <stdio.h>
#include <stdlib.h>
int main()
{
int MB=0;
while(malloc(1<<20))
++MB;
printf("Allocated %d MB total\n", MB);
return 0;
}