Merge pull request #292 from proller/tcmalloc

Dont use tcmalloc TCMALLOC_AGGRESSIVE_DECOMMIT patch
This commit is contained in:
alexey-milovidov 2016-12-28 10:11:39 +04:00 committed by GitHub
commit 00176b9c5e
2 changed files with 8 additions and 1 deletions

View File

@ -99,7 +99,7 @@ void Static::InitStaticVars() {
bool aggressive_decommit =
tcmalloc::commandlineflags::StringToBool(
TCMallocGetenvSafe("TCMALLOC_AGGRESSIVE_DECOMMIT"), false);
TCMallocGetenvSafe("TCMALLOC_AGGRESSIVE_DECOMMIT"), true);
pageheap_->SetAggressiveDecommit(aggressive_decommit);

View File

@ -1,3 +1,6 @@
#ifndef NO_TCMALLOC
#include <gperftools/malloc_extension.h>
#endif
#include "Server.h"
#include "LocalServer.h"
#include <DB/Common/StringUtils.h>
@ -33,6 +36,10 @@ static bool isClickhouseApp(const std::string & app_suffix, std::vector<char *>
int main(int argc_, char ** argv_)
{
#ifndef NO_TCMALLOC
MallocExtension::instance()->SetNumericProperty("tcmalloc.aggressive_memory_decommit", false);
#endif
std::vector<char *> argv(argv_, argv_ + argc_);
auto main_func = mainEntryClickHouseServer;