diff --git a/src/server/server.cc b/src/server/server.cc index 29a2d0282c7..02127f4734e 100644 --- a/src/server/server.cc +++ b/src/server/server.cc @@ -186,7 +186,7 @@ Status Server::Start() { } } }); - + memory_startup_use_ = Stats::GetMemoryRSS(); LOG(INFO) << "Ready to accept connections"; return Status::OK(); @@ -818,6 +818,7 @@ void Server::GetMemoryInfo(std::string *info) { string_stream << "used_memory_human:" << used_memory_rss_human << "\r\n"; string_stream << "used_memory_lua:" << memory_lua << "\r\n"; string_stream << "used_memory_lua_human:" << used_memory_lua_human << "\r\n"; + string_stream << "used_memory_startup:" << memory_startup_use_ << "\r\n"; *info = string_stream.str(); } diff --git a/src/server/server.h b/src/server/server.h index 715edc96671..c539c267607 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -281,6 +281,9 @@ class Server { TaskRunner task_runner_; std::vector> worker_threads_; std::unique_ptr replication_thread_; + + // memory + int64_t memory_startup_use_ = 0; }; extern Server *srv;