diff --git a/buildheader/db.h_4_1 b/buildheader/db.h_4_1 index 673180c73dc..8350a47f059 100644 --- a/buildheader/db.h_4_1 +++ b/buildheader/db.h_4_1 @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/buildheader/db.h_4_3 b/buildheader/db.h_4_3 index 2863cf87a48..cb74c3a75bc 100644 --- a/buildheader/db.h_4_3 +++ b/buildheader/db.h_4_3 @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/buildheader/db.h_4_4 b/buildheader/db.h_4_4 index 3edbe9fab21..4aaa670cae8 100644 --- a/buildheader/db.h_4_4 +++ b/buildheader/db.h_4_4 @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/buildheader/db.h_4_5 b/buildheader/db.h_4_5 index 0b4640dd0e3..0637332db9a 100644 --- a/buildheader/db.h_4_5 +++ b/buildheader/db.h_4_5 @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/buildheader/db.h_4_6 b/buildheader/db.h_4_6 index 4659e3fb289..7e4cac359ea 100644 --- a/buildheader/db.h_4_6 +++ b/buildheader/db.h_4_6 @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/buildheader/make_db_h.c b/buildheader/make_db_h.c index b70768615de..c71c800d2b6 100644 --- a/buildheader/make_db_h.c +++ b/buildheader/make_db_h.c @@ -692,6 +692,7 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__ printf(" uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ \n"); printf(" uint64_t mem_freed; /* number of bytes freed */ \n"); printf(" uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ \n"); + printf(" uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ \n"); printf(" const char * mallocator_version; /* version string from malloc lib */ \n"); printf("} ENGINE_STATUS;\n"); diff --git a/buildheader/tdb.h b/buildheader/tdb.h index 3ea2583d1c5..b3e5ae6c857 100644 --- a/buildheader/tdb.h +++ b/buildheader/tdb.h @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/include/db.h b/include/db.h index 3ea2583d1c5..b3e5ae6c857 100644 --- a/include/db.h +++ b/include/db.h @@ -299,6 +299,7 @@ typedef struct __toku_engine_status { uint64_t mem_used; /* number of bytes used (obtained from malloc_usable_size()) */ uint64_t mem_freed; /* number of bytes freed */ uint64_t max_mem_in_use; /* estimated max value of (used - freed) */ + uint64_t malloc_mmap_threshold; /* threshold for malloc to use mmap */ const char * mallocator_version; /* version string from malloc lib */ } ENGINE_STATUS; typedef enum { diff --git a/src/ydb.c b/src/ydb.c index e822dbca3e2..3a76df37cbc 100644 --- a/src/ydb.c +++ b/src/ydb.c @@ -2213,6 +2213,7 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st engstat->mem_used = memory_status.used; engstat->mem_freed = memory_status.freed; engstat->max_mem_in_use = memory_status.max_in_use; + engstat->malloc_mmap_threshold = memory_status.mmap_threshold; engstat->mallocator_version = memory_status.mallocator_version; } } @@ -2481,6 +2482,7 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) { n += snprintf(buff + n, bufsiz - n, "mem_used %"PRIu64"\n", engstat.mem_used); n += snprintf(buff + n, bufsiz - n, "mem_freed %"PRIu64"\n", engstat.mem_freed); n += snprintf(buff + n, bufsiz - n, "max_mem_in_use %"PRIu64"\n", engstat.max_mem_in_use); + n += snprintf(buff + n, bufsiz - n, "malloc_mmap_threshold %"PRIu64"\n", engstat.malloc_mmap_threshold); n += snprintf(buff + n, bufsiz - n, "mallocator_version %s\n", engstat.mallocator_version); } if (n > bufsiz) {