From 94918ae84bec80c9aca7b03e14b2d0f2ddb76123 Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 15 Jan 2016 14:13:08 -0800 Subject: [PATCH] db_bench: explicitly clear buffer in compress benchmark Summary: It is reported that in compress benchmark in db_bench, zlib will cause an OOM. The suggestd fix was to clear the buffer. Test Plan: Build and run compress benchmark. Reviewers: IslamAbdelRahman, yhchiang, rven, andrewkr, kradhakrishnan, anthony Reviewed By: anthony Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D52857 --- db/db_bench.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/db/db_bench.cc b/db/db_bench.cc index a07798b41..a0d767ea6 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -2262,6 +2262,7 @@ class Benchmark { // Compress 1G while (ok && bytes < int64_t(1) << 30) { + compressed.clear(); ok = CompressSlice(input, &compressed); produced += compressed.size(); bytes += input.size();