#include #include #include #include int main(int ac, char *av[]) { int64_t amount = atoll(av[1]); int touch = ac > 2 && atoi(av[2]) == 1; fork(); printf("Allocating %lld bytes\n", amount); char * buffer = malloc(amount); if (buffer == NULL) { perror("malloc"); exit(-1); } if (touch) { size_t i, pgsize = getpagesize(); for (i = 0; i < amount; i += pgsize) buffer[i] = 0; } while (1) sleep(1); return 0; }