#include #include #define INCR (1024*1024) main() { char *mem; unsigned total = 0; for(;;) { mem = malloc(INCR); int i; for (i = 0; i < INCR; i++) mem[i] = 42; total += INCR; printf("Total so far: %u MB\n", total / 1024 / 1024); } }