#include #include #include #include #include #define CHUNK 4194304 // 4 MB int main() { printf("Welcome to memeater! This little program is designed to eat up all the memory on your system.\n"); sleep(1); void* allocated = malloc(CHUNK); do { printf("Allocating 4 MB of memory... %lx\n", (unsigned long)allocated); sleep(1); } while ((allocated = malloc(CHUNK))); perror("malloc"); printf("Press any key to restart.\n"); }