memgraph/tests/concurrent/sl_memory.cpp
florijan b2f3dc1916 Available memory logging, utils/sysinfo/memory cleanup, tests/concurrent cleanup.
Summary:
Added a warning to the log. Every 3 seconds (let's not make that configurable). Can be turned off.

I still don't like this. We are raising another thread and reading a file to do monitoring. We're developing a DB, not a sys monitor. Serious admins do that themselves. But, here it is.

UPDATE:
Cleaned up `utils/sysinfo/memory`. Removed all unused functions. Removed the faulty memory check in `tests/concurrent`.

Reviewers: buda, mferencevic, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D819
2017-09-22 16:06:30 +02:00

25 lines
599 B
C++

#include "common.hpp"
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t elements = 2e6;
/**
* Put elements number of elements in the skiplist per each thread and see
* is there any memory leak
*/
int main(int argc, char **argv) {
google::InitGoogleLogging(argv[0]);
map_t skiplist;
auto futures = run<size_t>(THREADS_NO, skiplist, [](auto acc, auto index) {
for (size_t i = 0; i < elements; i++) {
acc.insert(i, index);
}
return index;
});
collect(futures);
auto accessor = skiplist.access();
check_size<map_t>(accessor, elements);
}