This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------- Summary ------------- | |
Total Free Chunked Memory:4365301296 | |
Total Chunked Avbl Memory:17963147264 | |
Total Memory Utilization:76% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MALLOC_CONF="dirty_decay_ms:0" LD_PRELOAD=/usr/local/lib/libjemalloc.so ./memory-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
// Define constants to make sure strings are not allocated at the top of the heap | |
#define HIT_ENTER "Press Enter to continue...\n" | |
#define ALLOCATED "500k 5KB chunks were just provisioned\n" | |
#define FREED "The first allocations were just free()'d.\n" |