Add malloc_trim

Summary: Lets run daily tonight with malloc_trim and see what is memory usage

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D888
This commit is contained in:
Mislav Bradac 2017-10-09 14:47:36 +02:00
parent 2fd43019d3
commit 93b9592c63

View File

@ -1,5 +1,7 @@
#include <functional>
#include <malloc.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
@ -134,6 +136,13 @@ void GraphDb::CollectGarbage() {
<< x.Elapsed().count();
}
{
utils::Timer x;
malloc_trim(0);
VLOG(1) << "Garbage collector malloc trim phase time: "
<< x.Elapsed().count();
}
LOG(INFO) << "Garbage collector finished";
VLOG(2) << "gc snapshot: " << snapshot;
VLOG(2) << "edge_record_deleter_ size: " << edge_record_deleter_.Count();