]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[pzstd] Reduce memory usage to 60-75% of previous
authorNick Terrell <terrelln@fb.com>
Wed, 21 Sep 2016 22:12:23 +0000 (15:12 -0700)
committerNick Terrell <terrelln@fb.com>
Wed, 21 Sep 2016 22:12:23 +0000 (15:12 -0700)
contrib/pzstd/Pzstd.cpp

index fceb49a7c0e253ab316d5f148f6762a21ffe4f53..5dd84124d338dd46b627333e8f270ff378fa594c 100644 (file)
@@ -61,7 +61,7 @@ static size_t handleOneInput(const Options &options,
   auto inputSize = fileSizeOrZero(inputFile);
   // WorkQueue outlives ThreadPool so in the case of error we are certain
   // we don't accidently try to call push() on it after it is destroyed.
-  WorkQueue<std::shared_ptr<BufferWorkQueue>> outs{2 * options.numThreads};
+  WorkQueue<std::shared_ptr<BufferWorkQueue>> outs{options.numThreads + 1};
   size_t bytesWritten;
   {
     // Initialize the thread pool with numThreads + 1