You know you're a hopeless geek when the highlight of your day is writing this:
#include <stdlib.h>
int main() {
int memory = 1000000000;
char *chomper;
printf("Eating %d bytes of precious memory\n",memory);
chomper = malloc(memory);
char *food;
food = malloc(40000 * sizeof(char));
int c;
for (c = 0; c < 10000; c++) {
strcat(food,"FOOD");
}
while(sizeof(chomper) < memory) {
strcat(chomper,food);
}
sleep(30);
}
In case anybody's curious, I wrote it to figure out how linux enforced cgroups limits.
#include <stdlib.h>
int main() {
int memory = 1000000000;
char *chomper;
printf("Eating %d bytes of precious memory\n",memory);
chomper = malloc(memory);
char *food;
food = malloc(40000 * sizeof(char));
int c;
for (c = 0; c < 10000; c++) {
strcat(food,"FOOD");
}
while(sizeof(chomper) < memory) {
strcat(chomper,food);
}
sleep(30);
}
In case anybody's curious, I wrote it to figure out how linux enforced cgroups limits.
VIEW 13 of 13 COMMENTS
mistersatan:
Don't die!
throttlebitch:
When are we going to play pool again? Some place with a decent table though...