#include main(int argc, char *argv[]) { void *p; int sz = getpagesize(); int max=0, total=0; if (argc > 1) max = atoi(argv[1]); while(1) { p = (void *)malloc(sz); if (p) memset(p, 0, sz); else break; total += sz; if (max && total >= max) break; } pause(); }