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
main
sdong 9 years ago
parent fdbff42391
commit 94918ae84b
  1. 1
      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();

Loading…
Cancel
Save