Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Building
--------

$ (install libevent + headers)
$ ./compile
$ make

Usage
-----
Expand Down
6 changes: 4 additions & 2 deletions balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ int main(int argc, char **argv) {
int size = atoi(argv[1]);
printf("megabytes: %d\n", size);

for (int x = 0; x < size; x++) {
int x;
for (x = 0; x < size; x++) {
// We're going to leak this.
uint64_t *temp = calloc(1, 1024 * 1024);
if (temp == NULL) {
fprintf(stderr, "Failed to calloc chunk #%d\n", x);
exit(1);
}
int i;
// Fill a bit harder to ensure RAM gets allocated
for (int i = 0; i < (1024*1024) / sizeof(uint64_t); i++) {
for (i = 0; i < (1024*1024) / sizeof(uint64_t); i++) {
temp[i] = i;
}
}
Expand Down