summaryrefslogtreecommitdiff
path: root/src/mongo/util/tcmalloc_server_status_section.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/util/tcmalloc_server_status_section.cpp')
-rw-r--r--src/mongo/util/tcmalloc_server_status_section.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mongo/util/tcmalloc_server_status_section.cpp b/src/mongo/util/tcmalloc_server_status_section.cpp
index 303076ba784..784f74e8cf8 100644
--- a/src/mongo/util/tcmalloc_server_status_section.cpp
+++ b/src/mongo/util/tcmalloc_server_status_section.cpp
@@ -38,6 +38,7 @@
#include "mongo/base/init.h"
#include "mongo/db/commands/server_status.h"
+#include "mongo/db/server_parameters.h"
#include "mongo/db/service_context.h"
#include "mongo/transport/transport_layer.h"
#include "mongo/util/log.h"
@@ -55,11 +56,17 @@ const int kManyClients = 40;
stdx::mutex tcmallocCleanupLock;
+MONGO_EXPORT_SERVER_PARAMETER(tcmallocEnableMarkThreadIdle, bool, true);
+
/**
* Callback to allow TCMalloc to release freed memory to the central list at
* favorable times. Ideally would do some milder cleanup or scavenge...
*/
void threadStateChange() {
+ if (!tcmallocEnableMarkThreadIdle.load()) {
+ return;
+ }
+
if (getGlobalServiceContext()->getTransportLayer()->sessionStats().numOpenSessions <=
kManyClients)
return;
@@ -156,6 +163,25 @@ public:
appendNumericPropertyIfAvailable(
sub, "aggressive_memory_decommit", "tcmalloc.aggressive_memory_decommit");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_committed_bytes", "tcmalloc.pageheap_committed_bytes");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_scavenge_count", "tcmalloc.pageheap_scavenge_count");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_commit_count", "tcmalloc.pageheap_commit_count");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_total_commit_bytes", "tcmalloc.pageheap_total_commit_bytes");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_decommit_count", "tcmalloc.pageheap_decommit_count");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_total_decommit_bytes", "tcmalloc.pageheap_total_decommit_bytes");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_reserve_count", "tcmalloc.pageheap_reserve_count");
+ appendNumericPropertyIfAvailable(
+ sub, "pageheap_total_reserve_bytes", "tcmalloc.pageheap_total_reserve_bytes");
+ appendNumericPropertyIfAvailable(
+ sub, "spinlock_total_delay_ns", "tcmalloc.spinlock_total_delay_ns");
+
#if MONGO_HAVE_GPERFTOOLS_SIZE_CLASS_STATS
if (verbosity >= 2) {
// Size class information