Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * allocbot.c - mindlessly allocate memory
- *
- * Florian Dejonckheere <florian@floriandejonckheere.be
- *
- * */
- #include <stdio.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <strings.h>
- #define ALLOC (10 * 1024 * 1024)
- void main() {
- while(1) {
- // Allocate 10 MiB
- void *ptr = malloc(ALLOC);
- bzero(ptr, ALLOC);
- printf("Allocated 10 MiB\n");
- usleep(100000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement