进程内存分配大小上限查询

#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;
}

原文地址:https://www.cnblogs.com/WangCT/p/2272863.html