From ffc9f84649b23cc33ba6b7fc7a97561d9bb1cc93 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Tue, 8 Jan 2019 17:16:37 -0800 Subject: [PATCH] Free memory after use Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/4857 Differential Revision: D13602688 Pulled By: riversand963 fbshipit-source-id: 993419a6afb982a7a701ff71daebebb4b4a6b265 --- tools/db_stress.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index 8682fbf38..71240fdaf 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -3802,6 +3802,14 @@ class AtomicFlushStressTest : public StressTest { &cf_handles, &checkpoint_db); } } + if (checkpoint_db != nullptr) { + for (auto cfh : cf_handles) { + delete cfh; + } + cf_handles.clear(); + delete checkpoint_db; + checkpoint_db = nullptr; + } DestroyDB(checkpoint_dir, Options()); if (!s.ok()) { fprintf(stderr, "A checkpoint operation failed with: %s\n",