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.
MAR 11, 2009 03:39 PM
MAR 11, 2009 04:22 PM
MAR 15, 2009 12:37 PM
MAR 18, 2009 11:58 AM
MAR 18, 2009 12:22 PM
APR 03, 2009 01:02 PM
MAY 08, 2009 10:44 AM
MAY 08, 2009 01:05 PM
JUL 11, 2009 04:48 PM
JUL 31, 2009 01:42 PM
AUG 07, 2009 10:47 AM
AUG 07, 2009 10:48 AM
SEP 22, 2009 08:43 AM
MAY 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
APRIL 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
MARCH 2009
FEBRUARY 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28











