#include #include int main(void) { void* foo; int i = 0; while((foo = (void *)malloc(1024 * 1024)) != NULL) { printf("%dM %lx - %lx\n", i++, (unsigned long)foo, (unsigned long)foo + 1024 * 1024); memset(foo, 0x00, 1024 * 1024); } perror("malloc error message"); return 0; }