Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <string.h>
- #define BUFSIZE 1073741824 //1GiB
- int main(){
- printf("start\n");
- printf("%lu \n", sizeof(u_int32_t));
- for(size_t i = 0; i < (BUFSIZE / 4); i++){
- u_int32_t* p = malloc(sizeof(u_int32_t));
- if (p == NULL){
- printf("alloc failed\n");
- exit(1);
- }
- } //eats around 8GiB
- sleep(15);
- printf("exit\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment